Annotation of embedaddon/php/ext/spl/tests/spl_003.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: class_parents() and class_implements()
! 3: --FILE--
! 4: <?php
! 5: class a{}
! 6: class b extends a{}
! 7: class c extends b{}
! 8: class d{}
! 9: var_dump(class_parents(new c),
! 10: class_parents("c"),
! 11: class_parents(new b),
! 12: class_parents("b"),
! 13: class_parents("d"),
! 14: class_parents("foo", 0),
! 15: class_parents("foo", 1)
! 16: );
! 17:
! 18: interface iface1{}
! 19: interface iface2{}
! 20: class f implements iface1, iface2{}
! 21: var_dump(class_implements(new a),
! 22: class_implements("a"),
! 23: class_implements("aaa"),
! 24: class_implements("bbb", 0)
! 25: );
! 26:
! 27: function __autoload($cname) {
! 28: var_dump($cname);
! 29: }
! 30:
! 31: ?>
! 32: ===DONE===
! 33: <?php exit(0); ?>
! 34: --EXPECTF--
! 35: Warning: class_parents(): Class foo does not exist in %sspl_003.php on line %d
! 36: string(3) "foo"
! 37:
! 38: Warning: class_parents(): Class foo does not exist and could not be loaded in %sspl_003.php on line %d
! 39: array(2) {
! 40: ["b"]=>
! 41: string(1) "b"
! 42: ["a"]=>
! 43: string(1) "a"
! 44: }
! 45: array(2) {
! 46: ["b"]=>
! 47: string(1) "b"
! 48: ["a"]=>
! 49: string(1) "a"
! 50: }
! 51: array(1) {
! 52: ["a"]=>
! 53: string(1) "a"
! 54: }
! 55: array(1) {
! 56: ["a"]=>
! 57: string(1) "a"
! 58: }
! 59: array(0) {
! 60: }
! 61: bool(false)
! 62: bool(false)
! 63: string(3) "aaa"
! 64:
! 65: Warning: class_implements(): Class aaa does not exist and could not be loaded in %sspl_003.php on line %d
! 66:
! 67: Warning: class_implements(): Class bbb does not exist in %sspl_003.php on line %d
! 68: array(0) {
! 69: }
! 70: array(0) {
! 71: }
! 72: bool(false)
! 73: bool(false)
! 74: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>