From:             m dot kurzyna at crystalpoint dot pl
Operating system: Linux
PHP version:      5.1.4
PHP Bug Type:     SimpleXML related
Bug description:  autocreating element doesn't assign value to first node

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)

-- 
Edit bug report at http://bugs.php.net/?id=37386&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37386&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37386&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37386&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37386&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37386&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37386&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37386&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37386&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37386&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37386&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37386&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37386&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37386&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37386&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37386&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37386&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37386&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37386&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37386&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37386&r=mysqlcfg

Reply via email to