Annotation of embedaddon/php/Zend/tests/lsb_019.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: ZE2 Late Static Binding properties and methods declared as protected and overridden as public. 
        !             3: --FILE--
        !             4: <?php
        !             5: class TestClass {
        !             6:        protected static $staticVar;
        !             7: 
        !             8:        protected static function staticFunction() {
        !             9:                return 'TestClassFunction';
        !            10:        }
        !            11:        
        !            12:        public static function testStaticVar() {
        !            13:                TestClass::$staticVar = 'TestClassStatic';
        !            14:                ChildClass1::$staticVar = 'ChildClassStatic';
        !            15:                return static::$staticVar;
        !            16:        }
        !            17: 
        !            18:        public static function testStaticFunction() {
        !            19:                return static::staticFunction();
        !            20:        }
        !            21: }
        !            22: 
        !            23: class ChildClass1 extends TestClass {
        !            24:        public static $staticVar;
        !            25: 
        !            26:        public static function staticFunction() {
        !            27:                return 'ChildClassFunction';
        !            28:        }
        !            29: }
        !            30: 
        !            31: class ChildClass2 extends TestClass {}
        !            32: 
        !            33: echo TestClass::testStaticVar() . "\n";
        !            34: echo TestClass::testStaticFunction() . "\n";
        !            35: 
        !            36: echo ChildClass1::testStaticVar() . "\n";
        !            37: echo ChildClass1::testStaticFunction() . "\n";
        !            38: 
        !            39: echo ChildClass2::testStaticVar() . "\n";
        !            40: echo ChildClass2::testStaticFunction() . "\n";
        !            41: ?>
        !            42: --EXPECTF--
        !            43: TestClassStatic
        !            44: TestClassFunction
        !            45: ChildClassStatic
        !            46: ChildClassFunction
        !            47: TestClassStatic
        !            48: TestClassFunction

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>