Annotation of embedaddon/php/Zend/tests/lsb_003.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ZE2 Late Static Binding creating a new class with 'static'
! 3: --FILE--
! 4: <?php
! 5:
! 6: class TestClass {
! 7: public static function createInstance() {
! 8: return new static();
! 9: }
! 10: }
! 11:
! 12: class ChildClass extends TestClass {}
! 13:
! 14: $testClass = TestClass::createInstance();
! 15: $childClass = ChildClass::createInstance();
! 16:
! 17: echo get_class($testClass) . "\n";
! 18: echo get_class($childClass) . "\n";
! 19: ?>
! 20: ==DONE==
! 21: --EXPECTF--
! 22: TestClass
! 23: ChildClass
! 24: ==DONE==
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>