Annotation of embedaddon/php/ext/standard/tests/math/abs_error.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test abs() function :  error conditions - incorrect number of args
        !             3: --FILE--
        !             4: <?php
        !             5: /* Prototype  : number abs  ( mixed $number  )
        !             6:  * Description: Returns the absolute value of number.
        !             7:  * Source code: ext/standard/math.c
        !             8:  */
        !             9: 
        !            10: /*
        !            11:  * Pass incorrect number of arguments to abs() to test behaviour
        !            12:  */
        !            13:  
        !            14: echo "*** Testing abs() : error conditions ***\n";
        !            15: 
        !            16: $arg_0 = 1.0;
        !            17: $extra_arg = 1;
        !            18: 
        !            19: echo "\nToo many arguments\n";
        !            20: var_dump(abs($arg_0, $extra_arg));
        !            21: 
        !            22: echo "\nToo few arguments\n";
        !            23: var_dump(abs());
        !            24: 
        !            25: ?>
        !            26: ===Done===
        !            27: --EXPECTF--
        !            28: *** Testing abs() : error conditions ***
        !            29: 
        !            30: Too many arguments
        !            31: 
        !            32: Warning: abs() expects exactly 1 parameter, 2 given in %s on line %d
        !            33: NULL
        !            34: 
        !            35: Too few arguments
        !            36: 
        !            37: Warning: abs() expects exactly 1 parameter, 0 given in %s on line %d
        !            38: NULL
        !            39: ===Done===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>