Annotation of embedaddon/php/ext/standard/tests/class_object/method_exists_basic_002.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: method_exists() on internal classes
3: --FILE--
4: <?php
5: /* Prototype : proto bool is_subclass_of(object object, string class_name)
6: * Description: Returns true if the object has this class as one of its parents
7: * Source code: Zend/zend_builtin_functions.c
8: * Alias to functions:
9: */
10:
11: echo " ---(Internal classes, using string class name)---\n";
12: echo "Does exception::getmessage exist? ";
13: var_dump(method_exists("exception", "getmessage"));
14: echo "Does stdclass::nonexistent exist? ";
15: var_dump(method_exists("stdclass", "nonexistent"));
16:
17: echo "\n ---(Internal classes, using class instance)---\n";
18: echo "Does exception::getmessage exist? ";
19: var_dump(method_exists(new exception, "getmessage"));
20: echo "Does stdclass::nonexistent exist? ";
21: var_dump(method_exists(new stdclass, "nonexistent"));
22:
23: echo "Done";
24: ?>
25: --EXPECTF--
26: ---(Internal classes, using string class name)---
27: Does exception::getmessage exist? bool(true)
28: Does stdclass::nonexistent exist? bool(false)
29:
30: ---(Internal classes, using class instance)---
31: Does exception::getmessage exist? bool(true)
32: Does stdclass::nonexistent exist? bool(false)
33: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>