Annotation of embedaddon/php/Zend/tests/009.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: get_class() tests
! 3: --FILE--
! 4: <?php
! 5:
! 6: class foo {
! 7: function bar () {
! 8: var_dump(get_class());
! 9: }
! 10: }
! 11:
! 12: class foo2 extends foo {
! 13: }
! 14:
! 15: foo::bar();
! 16: foo2::bar();
! 17:
! 18: $f1 = new foo;
! 19: $f2 = new foo2;
! 20:
! 21: $f1->bar();
! 22: $f2->bar();
! 23:
! 24: var_dump(get_class());
! 25: var_dump(get_class("qwerty"));
! 26:
! 27: var_dump(get_class($f1));
! 28: var_dump(get_class($f2));
! 29:
! 30: echo "Done\n";
! 31: ?>
! 32: --EXPECTF--
! 33: Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
! 34: string(3) "foo"
! 35:
! 36: Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
! 37: string(3) "foo"
! 38: string(3) "foo"
! 39: string(3) "foo"
! 40:
! 41: Warning: get_class() called without object from outside a class in %s on line %d
! 42: bool(false)
! 43:
! 44: Warning: get_class() expects parameter 1 to be object, string given in %s on line %d
! 45: bool(false)
! 46: string(3) "foo"
! 47: string(4) "foo2"
! 48: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>