Annotation of embedaddon/php/Zend/tests/lsb_010.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ZE2 Late Static Binding using static:: in functions called by non execute() calls and constructors.
! 3: --FILE--
! 4: <?php
! 5:
! 6: class Foo {
! 7: protected static $className = 'Foo';
! 8: public static function bar() {
! 9: echo static::$className . "::bar\n";
! 10: }
! 11: public function __construct() {
! 12: echo static::$className . "::__construct\n";
! 13: }
! 14: public function __destruct() {
! 15: echo static::$className . "::__destruct\n";
! 16: }
! 17: }
! 18:
! 19: class FooChild extends Foo {
! 20: protected static $className = 'FooChild';
! 21: }
! 22:
! 23: register_shutdown_function(array('Foo', 'bar'));
! 24: register_shutdown_function(array('FooChild', 'bar'));
! 25:
! 26: $foo = new Foo();
! 27: $fooChild = new FooChild();
! 28: unset($foo);
! 29: unset($fooChild);
! 30:
! 31: ?>
! 32: --EXPECTF--
! 33: Foo::__construct
! 34: FooChild::__construct
! 35: Foo::__destruct
! 36: FooChild::__destruct
! 37: Foo::bar
! 38: FooChild::bar
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>