]> granicus.if.org Git - php/commitdiff
- MFH Add new test
authorMarcus Boerger <helly@php.net>
Fri, 23 Dec 2005 20:26:41 +0000 (20:26 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 23 Dec 2005 20:26:41 +0000 (20:26 +0000)
ext/simplexml/tests/bug35785.phpt [new file with mode: 0755]

diff --git a/ext/simplexml/tests/bug35785.phpt b/ext/simplexml/tests/bug35785.phpt
new file mode 100755 (executable)
index 0000000..2c3a54d
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+Bug #35785 (SimpleXML memory read error)
+--FILE--
+<?php
+
+$options["database"] = "xmldatabase";
+$xml = simplexml_load_string("<root></root>");
+$count = count($xml->posts) + 1;
+$xml->bla->posts[$count]->name = $_POST["name"];
+echo $xml->asXML();
+?>
+===DONE===
+<?php exit(0); __halt_compiler(); ?>
+--EXPECTF--
+
+Notice: Undefined index:  name in %sbug35785.phpt on line %d
+
+Strict Standards: Creating default object from empty value in %sbug35785.phpt on line %d
+
+Warning: Attempt to assign property of non-object in %sbug35785.phpt on line %d
+<?xml version="1.0"?>
+<root/>