diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-26 12:22:48 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-27 10:11:47 +0200 |
commit | a66c60cce3cd8878284fb39388080cfb6bac8ff5 (patch) | |
tree | 417941074c593391c0b61613082b69334e757cf4 /Zend/tests/bug75573.phpt | |
parent | e8d2097bdc467e4ad814e23b406f70c3dc568ff4 (diff) | |
download | php-git-a66c60cce3cd8878284fb39388080cfb6bac8ff5.tar.gz |
Throw Error when writing property of non-object
This removes object auto-vivification support.
This also means that we can remove the corresponding special
handling for typed properites: We no longer need to check that a
property is convertible to stdClass if such a conversion might
take place indirectly due to a nested property write.
Additionally OBJ_W style operations now no longer modify the
object operand, and as such we no longer need to treat op1 as a
def in SSA form.
The next step would be to actually compile the whole LHS of OBJ_W
operations in R rather than W mode, but that causes issues with
SimpleXML, whose object handlers depend on the current compilation
structure.
Part of https://wiki.php.net/rfc/engine_warnings.
Diffstat (limited to 'Zend/tests/bug75573.phpt')
-rw-r--r-- | Zend/tests/bug75573.phpt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Zend/tests/bug75573.phpt b/Zend/tests/bug75573.phpt index f5e87f8283..867f5d597f 100644 --- a/Zend/tests/bug75573.phpt +++ b/Zend/tests/bug75573.phpt @@ -6,6 +6,10 @@ Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26) class A { var $_stdObject; + function __construct() + { + $this->_stdObject = new stdClass; + } function &__get($property) { if (isset($this->_stdObject->{$property})) { @@ -44,9 +48,7 @@ var_dump($b->name); var_dump($b->settings); ?> --EXPECTF-- -Warning: Creating default object from empty value in %sbug75573.php on line %d - -Notice: Only variable references should be returned by reference in %sbug75573.php on line %d +Notice: Only variable references should be returned by reference in %s on line %d string(3) "abc" array(2) { ["foo"]=> |