mirror of
https://github.com/php/php-src.git
synced 2026-04-20 22:41:20 +02:00
For rationale, see https://github.com/php/php-src/pull/6787 Make extension checks lowercase, add a special case for opcache that has internal name not matching .so filename. Extensions migrated in part 2: * dom * exif * fileinfo * ffi
34 lines
648 B
PHP
34 lines
648 B
PHP
--TEST--
|
|
Bug #47430 (Errors after writing to nodeValue parameter of an absent previousSibling).
|
|
--EXTENSIONS--
|
|
dom
|
|
--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" on null
|
|
Attempt to assign property "nodeValue" on null
|
|
Array
|
|
(
|
|
[0] => Value
|
|
)
|