summaryrefslogtreecommitdiff
path: root/ext/dom/tests/bug47430.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/bug47430.phpt')
-rw-r--r--ext/dom/tests/bug47430.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/dom/tests/bug47430.phpt b/ext/dom/tests/bug47430.phpt
new file mode 100644
index 0000000..243fe84
--- /dev/null
+++ b/ext/dom/tests/bug47430.phpt
@@ -0,0 +1,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
+)