blob: 243fe8441cca0d8b8589dd443e88427618bbe1f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
--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) {
$i->previousSibling->nodeValue = '';
}
$arr = array();
$arr[0] = 'Value';
print_r($arr);
?>
--EXPECTF--
Warning: Creating default object from empty value in %s on line %d
Warning: Creating default object from empty value in %s on line %d
Array
(
[0] => Value
)
|