Annotation of embedaddon/php/Zend/tests/objects_027.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Testing 'new static;' calling parent method
! 3: --FILE--
! 4: <?php
! 5:
! 6: class bar {
! 7: public function show() {
! 8: var_dump(new static);
! 9: }
! 10: }
! 11:
! 12: class foo extends bar {
! 13: public function test() {
! 14: parent::show();
! 15: }
! 16: }
! 17:
! 18: $foo = new foo;
! 19: $foo->test();
! 20: $foo::test();
! 21:
! 22: call_user_func(array($foo, 'test'));
! 23: call_user_func(array('foo', 'test'));
! 24:
! 25: ?>
! 26: --EXPECTF--
! 27: object(foo)#%d (0) {
! 28: }
! 29:
! 30: Strict Standards: Non-static method foo::test() should not be called statically in %s on line %d
! 31:
! 32: Strict Standards: Non-static method bar::show() should not be called statically in %s on line %d
! 33: object(foo)#%d (0) {
! 34: }
! 35: object(foo)#%d (0) {
! 36: }
! 37:
! 38: Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::test() should not be called statically in %s on line %d
! 39:
! 40: Strict Standards: Non-static method bar::show() should not be called statically in %s on line %d
! 41: object(foo)#%d (0) {
! 42: }
! 43:
! 44:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>