Merge branch 'PHP-7.0'

This commit is contained in:
Xinchen Hui committed 2015-11-07 06:50:43 -08:00
commit f76e57f1f3
2 files changed
+36 -2

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
--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
+2 -2
View File
@@ -275,10 +275,10 @@ static zend_always_inline int zend_verify_property_access(zend_property_info *pr
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;
}
/* }}} */