mirror of
https://github.com/php/php-src.git
synced 2026-04-21 15:08:16 +02:00
a66c60cce3
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.
34 lines
689 B
PHP
34 lines
689 B
PHP
--TEST--
|
|
Bug #47430 (Errors after writing to nodeValue parameter of an absent previousSibling).
|
|
--SKIPIF--
|
|
<?php require_once('skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
$xml = '<?xml
|
|
version="1.0"?><html><p><i>Hello</i></p><p><i>World!</i></p></html>';
|
|
$dom = new DOMDocument();
|
|
$dom->loadXML($xml);
|
|
|
|
$elements = $dom->getElementsByTagName('i');
|
|
foreach ($elements as $i) {
|
|
try {
|
|
$i->previousSibling->nodeValue = '';
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
}
|
|
|
|
$arr = array();
|
|
$arr[0] = 'Value';
|
|
|
|
print_r($arr);
|
|
|
|
?>
|
|
--EXPECT--
|
|
Attempt to assign property 'nodeValue' of non-object
|
|
Attempt to assign property 'nodeValue' of non-object
|
|
Array
|
|
(
|
|
[0] => Value
|
|
)
|