From: tater at potatoe dot com
Operating system: *
PHP version: 5CVS-2003-09-23 (dev)
PHP Bug Type: XML related
Bug description: simplexml element object properties return empty objects
Description:
------------
I guess this is related to the recent toString() stuff -
simplexml_element object properties can't be printed or
assigned, they all come out as 'Object #x'. the string
values turn into empty simplexml_element objects.
Reproduce code:
---------------
<?php
$xml = '<wrapper><foo>s1</foo><bar>s2</bar><bar>s3</bar></wrapper>';
$t = simplexml_load_string($xml);
var_dump($t,$t->foo,$t->bar);
?>
Expected result:
----------------
object(simplexml_element)#1 (2) {
["foo"]=>
string(2) "s1"
["bar"]=>
array(2) {
[0]=>
string(2) "s2"
[1]=>
string(2) "s3"
}
}
string(2) "s1"
array(2) {
[0]=>
string(2) "s2"
[1]=>
string(2) "s3"
}
Actual result:
--------------
object(simplexml_element)#1 (2) {
["foo"]=>
string(2) "s1"
["bar"]=>
array(2) {
[0]=>
string(2) "s2"
[1]=>
string(2) "s3"
}
}
object(simplexml_element)#2 (0) {
}
array(2) {
[0]=>
object(simplexml_element)#3 (0) {
}
[1]=>
object(simplexml_element)#4 (0) {
}
}
--
Edit bug report at http://bugs.php.net/?id=25640&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25640&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25640&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25640&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25640&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25640&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25640&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25640&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25640&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25640&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25640&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25640&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25640&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25640&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25640&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25640&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25640&r=float