Annotation of embedaddon/php/ext/standard/tests/general_functions/is_callable_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test is_callable() function
3: --INI--
4: precision=14
5: error_reporting = E_ALL & ~E_NOTICE | E_STRICT
6: --FILE--
7: <?php
8: /* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );
9: Description: Verify that the contents of a variable can be called as a function
10: In case of objects, $var = array($SomeObject, 'MethodName')
11: */
12:
13: echo "\n*** Testing error conditions ***\n";
14:
15: echo "\n-- Testing is_callable() function with less than expected no. of arguments --\n";
16: var_dump( is_callable() );
17:
18: echo "\n-- Testing is_callable() function with more than expected no. of arguments --\n";
19: var_dump( is_callable("string", TRUE, $callable_name, "EXTRA") );
20:
21: ?>
22: ===DONE===
23: --EXPECTF--
24: *** Testing error conditions ***
25:
26: -- Testing is_callable() function with less than expected no. of arguments --
27:
28: Warning: is_callable() expects at least 1 parameter, 0 given in %s on line %d
29: NULL
30:
31: -- Testing is_callable() function with more than expected no. of arguments --
32:
33: Warning: is_callable() expects at most 3 parameters, 4 given in %s on line %d
34: NULL
35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>