summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2008-02-28 17:38:04 +0000
committerRasmus Lerdorf <rasmus@php.net>2008-02-28 17:38:04 +0000
commit3be17e4f6628a3db260bf4c13d56219bc4cb2010 (patch)
tree7b357ec4e2a804aa72f91917e7b339c4a9ca7fde /ext
parent4cdbb5b060024683128c5f0be9bad982ab8bfb5d (diff)
downloadphp-git-3be17e4f6628a3db260bf4c13d56219bc4cb2010.tar.gz
count() before and after a simplexml array cast should be the same
Diffstat (limited to 'ext')
-rwxr-xr-xext/simplexml/tests/034.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/simplexml/tests/034.phpt b/ext/simplexml/tests/034.phpt
new file mode 100755
index 0000000000..8a783aae5c
--- /dev/null
+++ b/ext/simplexml/tests/034.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SimpleXML: array casting bug
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+$string = '<?xml version="1.0"?>
+<foo><bar>
+ <p>Blah 1</p>
+ <p>Blah 2</p>
+ <p>Blah 3</p>
+ <tt>Blah 4</tt>
+</bar></foo>
+';
+$foo = simplexml_load_string($string);
+$p = $foo->bar->p;
+echo count($p);
+$p = (array)$foo->bar->p;
+echo count($p);
+?>
+--EXPECTF--
+33