|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-09 19:44 UTC] m dot kurzyna at crystalpoint dot pl
Description:
------------
If autocreating new nodes by id ($obj->node[0] = '')
SimpleXML doesn't assign value to first node. Creating
first node w/o using id works fine.
Reproduce code:
---------------
<?php
$sx1 = new SimpleXMLElement("<root />");
$sx1->node[0] = 'node1';
$sx1->node[1] = 'node2';
?>
Expected result:
----------------
object(SimpleXMLElement)[1]
public 'node' =>
array
0 => 'node1' (length=5)
1 => 'node2' (length=5)
Actual result:
--------------
object(SimpleXMLElement)[1]
public 'node' =>
array
0 =>
object(SimpleXMLElement)[6]
1 => 'node2' (length=5)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
The same here as I went deeper into simplexml... PHP 5.2.0 Linux SimpleXMLElement Object ( [node] => Array ( [0] => SimpleXMLElement Object ( ) [1] => node2 ) )