summaryrefslogtreecommitdiff
path: root/Zend/tests/lsb_023.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/lsb_023.phpt')
-rw-r--r--Zend/tests/lsb_023.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/Zend/tests/lsb_023.phpt b/Zend/tests/lsb_023.phpt
new file mode 100644
index 0000000000..a8051aa85f
--- /dev/null
+++ b/Zend/tests/lsb_023.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Late Static Binding static:: calls protected / public method of child class even then
+the method is private in parent class
+--FILE--
+<?php
+class A {
+ public static function out() {
+ echo static::value(), PHP_EOL;
+ }
+
+ private static function value() { return 'A'; }
+}
+class B extends A {
+ protected static function value() { return 'B'; }
+}
+class C extends A {
+ public static function value() { return 'C'; }
+}
+A::out();
+B::out();
+C::out();
+echo PHP_EOL;
+--EXPECT--
+A
+B
+C