?? ??? 2015, PHP 7.0.1
- Core:
+ . Fixed bug #70873 (Regression on private static properties access).
+ (Laruence)
. Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite).
(Dmitry, Laruence)
. Fixed bug #70862 (Several functions do not check return code of
--- /dev/null
+--TEST--
+Bug #70873 (Regression on private static properties access)
+--FILE--
+<?php
+
+class A {
+ private static $x = 1;
+}
+
+class B extends A {
+ function bar() {
+ var_dump(self::$x);
+ }
+};
+
+class C extends A {
+ function bar() {
+ var_dump(A::$x);
+ }
+};
+
+
+$a = new B;
+$a->bar();
+
+$b = new C;
+$b->bar();
+?>
+--EXPECTF--
+Fatal error: Uncaught Error: Cannot access property B::$x in %sbug70873.php:%d
+Stack trace:
+#0 %sbug70873.php(%d): B->bar()
+#1 {main}
+ thrown in %sbug70873.php on line %d
return 1;
} else if (property_info->flags & ZEND_ACC_PRIVATE) {
return (ce == EG(scope) || property_info->ce == EG(scope));
- } else {
- ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
+ } else if (property_info->flags & ZEND_ACC_PROTECTED) {
return zend_check_protected(property_info->ce, EG(scope));
}
+ return 0;
}
/* }}} */