mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
5a4cb3edde
If a property access would normally result in a magic method call, but the property is subject to an active recursion guard, the access should behave as if the magic method does not exist. This commit fixes one instance where this was not the case -- we should have been generating a property access error, but instead the operation simply did not do anything.
29 lines
422 B
PHP
29 lines
422 B
PHP
--TEST--
|
|
Bug #48248 (SIGSEGV when access to private property via &__get)
|
|
--FILE--
|
|
<?php
|
|
|
|
class A
|
|
{
|
|
public function & __get($name)
|
|
{
|
|
return $this->test;
|
|
}
|
|
}
|
|
|
|
class B extends A
|
|
{
|
|
private $test;
|
|
}
|
|
|
|
$b = new B;
|
|
var_dump($b->test);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Cannot access private property B::$test in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): A->__get('test')
|
|
#1 {main}
|
|
thrown in %s on line %d
|