Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Exemple d’utilisation de ‘ASSERT’

 assert
{filelink=14308}

<?php

    function calcul_nombre_impair($x, $y) {
        assert('!(($x % 2) && ($y % 2))');
        return ($x + $y);
    }

    $total_1 = calcul_nombre_impair(3, 5);
    $total_2 = calcul_nombre_impair(2, 4);

    echo "3 + 5 = $total_1";
    echo "2 + 4 = $total_2";

?>

No comments yet.

Leave a Comment