]> granicus.if.org Git - php/commitdiff
test for bug #26976
authorfoobar <sniper@php.net>
Wed, 21 Jan 2004 03:17:07 +0000 (03:17 +0000)
committerfoobar <sniper@php.net>
Wed, 21 Jan 2004 03:17:07 +0000 (03:17 +0000)
ext/simplexml/tests/bug26976.phpt [new file with mode: 0644]

diff --git a/ext/simplexml/tests/bug26976.phpt b/ext/simplexml/tests/bug26976.phpt
new file mode 100644 (file)
index 0000000..c3e8385
--- /dev/null
@@ -0,0 +1,28 @@
+--TEST--
+Bug #26976 (Can not get array elements)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip simplexml extension is not loaded"; ?>
+--FILE--
+<?php
+
+$root = simplexml_load_string(
+'<?xml version="1.0"?>
+<root>
+ <child>a</child>
+ <child>b</child>
+ <child>c</child>
+ <child>d</child>
+</root>
+');
+
+echo $root->child[0], "\n";
+echo $root->child[1], "\n";
+echo $root->child[2], "\n";
+echo $root->child[3], "\n";
+
+?>
+--EXPECT--
+a
+b
+c
+d