mirror of
https://github.com/php/php-src.git
synced 2026-03-30 12:13:02 +02:00
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.
26 lines
375 B
PHP
26 lines
375 B
PHP
--TEST--
|
|
Bug #24499 (bogus handling of a public property as a private one)
|
|
--FILE--
|
|
<?php
|
|
class Id {
|
|
private $id="priv";
|
|
|
|
public function tester($obj)
|
|
{
|
|
$obj->id = "bar";
|
|
}
|
|
}
|
|
|
|
$id = new Id();
|
|
$obj = new stdClass;
|
|
$obj->foo = "bar";
|
|
$id->tester($obj);
|
|
print_r($obj);
|
|
?>
|
|
--EXPECT--
|
|
stdClass Object
|
|
(
|
|
[foo] => bar
|
|
[id] => bar
|
|
)
|