mirror of
https://github.com/php/php-src.git
synced 2026-04-03 22:22:18 +02:00
This goes in the reverse direction of 4463acb951.
After looking around a bit, it seems that we already check for
Z_ISERROR_P() on the get_property_ptr_ptr return value in other places.
So do this in zend_fetch_property_address() as well, and also make
sure that EG(error_zval) is indeed returned on exception in
get_property_ptr_ptr.
In particular, this fixes the duplicate exceptions that we used to
get because first get_property_ptr_ptr threw one and then
read_property throws the same exception again.
24 lines
454 B
PHP
24 lines
454 B
PHP
--TEST--
|
|
Attempting to access static properties using instance property syntax
|
|
--FILE--
|
|
<?php
|
|
class C {
|
|
protected static $y = 'C::$y';
|
|
}
|
|
$c = new C;
|
|
|
|
echo "\n--> Access non-visible static prop like instance prop:\n";
|
|
try {
|
|
$c->y =& $ref;
|
|
} catch (Error $e) {
|
|
echo $e, "\n";
|
|
}
|
|
?>
|
|
==Done==
|
|
--EXPECTF--
|
|
--> Access non-visible static prop like instance prop:
|
|
Error: Cannot access protected property C::$y in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
==Done==
|