Annotation of embedaddon/php/ext/standard/tests/class_object/get_class_error_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test get_class() function : error conditions - wrong number of arguments.
3: --FILE--
4: <?php
5: /* Prototype : proto string get_class([object object])
6: * Description: Retrieves the class name
7: * Source code: Zend/zend_builtin_functions.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing get_class() : error conditions ***\n";
12:
13: //Test get_class with one more than the expected number of arguments
14: echo "\n-- Testing get_class() function with more than expected no. of arguments --\n";
15: $object = new stdclass();
16: $extra_arg = 10;
17: var_dump( get_class($object, $extra_arg) );
18:
19: echo "Done";
20: ?>
21: --EXPECTF--
22: *** Testing get_class() : error conditions ***
23:
24: -- Testing get_class() function with more than expected no. of arguments --
25:
26: Warning: get_class() expects at most 1 parameter, 2 given in %s on line 14
27: bool(false)
28: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>