Annotation of embedaddon/php/ext/standard/tests/general_functions/floatval_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Testing floatval() and its alias doubleval() : error conditions - wrong numbers of parametersns
3: --FILE--
4: <?php
5: /* Prototype: float floatval( mixed $var );
6: * Description: Returns the float value of var.
7: */
8:
9: echo "*** Testing floatval() and doubleval() : error conditions ***\n";
10:
11:
12: echo "\n-- Testing floatval() and doubleval() function with no arguments --\n";
13: var_dump( floatval() );
14: var_dump( doubleval() );
15:
16: echo "\n-- Testing floatval() and doubleval() function with more than expected no. of arguments --\n";
17: var_dump( floatval(10.5, FALSE) );
18: var_dump( doubleval(10.5, FALSE) );
19:
20: ?>
21: ===DONE===
22: --EXPECTF--
23: *** Testing floatval() and doubleval() : error conditions ***
24:
25: -- Testing floatval() and doubleval() function with no arguments --
26:
27: Warning: floatval() expects exactly 1 parameter, 0 given in %s on line %d
28: NULL
29:
30: Warning: doubleval() expects exactly 1 parameter, 0 given in %s on line %d
31: NULL
32:
33: -- Testing floatval() and doubleval() function with more than expected no. of arguments --
34:
35: Warning: floatval() expects exactly 1 parameter, 2 given in %s on line %d
36: NULL
37:
38: Warning: doubleval() expects exactly 1 parameter, 2 given in %s on line %d
39: NULL
40: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>