summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/bug35785.phpt
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:35:13 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:35:13 -0400
commit0a36161e13484a99ccf69bb38f206462d27cc6d6 (patch)
treed5107db4b7369603ac7c753829e8972ee74949f7 /ext/simplexml/tests/bug35785.phpt
parentce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (diff)
downloadphp-upstream/5.1.2.tar.gz
Imported Upstream version 5.1.2upstream/5.1.2
Diffstat (limited to 'ext/simplexml/tests/bug35785.phpt')
-rwxr-xr-xext/simplexml/tests/bug35785.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/simplexml/tests/bug35785.phpt b/ext/simplexml/tests/bug35785.phpt
new file mode 100755
index 000000000..34489c5b1
--- /dev/null
+++ b/ext/simplexml/tests/bug35785.phpt
@@ -0,0 +1,23 @@
+--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.php on line %d
+
+Strict Standards: Creating default object from empty value in %sbug35785.php on line %d
+
+Warning: Attempt to assign property of non-object in %sbug35785.php on line %d
+<?xml version="1.0"?>
+<root/>
+===DONE===