1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00
Files
archived-php-src/ext/simplexml/tests/bug37386.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

26 lines
550 B
PHP

--TEST--
Bug #39760 (autocreating element doesn't assign value to first node)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip simplexml extension is not loaded"; ?>
--FILE--
<?php
$sx1 = new SimpleXMLElement("<root />");
$sx1->node[0] = 'node1';
$sx1->node[1] = 'node2';
print $sx1->asXML()."\n";
$node = $sx1->node[0];
$node[0] = 'New Value';
print $sx1->asXML();
?>
--EXPECT--
<?xml version="1.0"?>
<root><node>node1</node><node>node2</node></root>
<?xml version="1.0"?>
<root><node>New Value</node><node>node2</node></root>