diff options
Diffstat (limited to 'Zend/tests/lsb_020.phpt')
-rw-r--r-- | Zend/tests/lsb_020.phpt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Zend/tests/lsb_020.phpt b/Zend/tests/lsb_020.phpt new file mode 100644 index 0000000000..f328b01774 --- /dev/null +++ b/Zend/tests/lsb_020.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test LSB of properties and methods declared as public and overridden as public. +--FILE-- +<?php +class TestClass { + public static $staticVar; + + public static function staticFunction() { + return 'TestClassFunction'; + } + + public static function testStaticVar() { + TestClass::$staticVar = 'TestClassStatic'; + ChildClass1::$staticVar = 'ChildClassStatic'; + return static::$staticVar; + } + + public static function testStaticFunction() { + return static::staticFunction(); + } +} + +class ChildClass1 extends TestClass { + public static $staticVar; + + public static function staticFunction() { + return 'ChildClassFunction'; + } +} + +class ChildClass2 extends TestClass {} + +echo TestClass::testStaticVar() . "\n"; +echo TestClass::testStaticFunction() . "\n"; + +echo ChildClass1::testStaticVar() . "\n"; +echo ChildClass1::testStaticFunction() . "\n"; + +echo ChildClass2::testStaticVar() . "\n"; +echo ChildClass2::testStaticFunction() . "\n"; +?> +--EXPECTF-- +TestClassStatic +TestClassFunction +ChildClassStatic +ChildClassFunction +TestClassStatic +TestClassFunction
\ No newline at end of file |