PHP5 simpleXML bug or am i just being silly :)
| From: | William Bailey | Date: | Thu, 26 Feb 2004 18:17:45 +0000 |
| Subject: | PHP5 simpleXML bug or am i just being silly :) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-178951@lists.php.net to get a copy of this message | ||
Hi All,
I am currently working with PHP5 beta and have found something strange with the simplexml objects. It seems to be forgetting its values. Below is an example..
[[the PHP5 code]]
<snip>
print('<pre>');
print('<p>$this->user::</p>');
print_r($this->user);
print('<p>$this->user->site::</p>');
print_r($this->user->site);
print('<p>$this->user->site[0]::</p>');
print_r($this->user->site[0]);
die('</pre>');
<snip>
[[END]]
[[the PHP5 Browser Output]]
$this->user::
simplexml_element Object
(
[login] => wb
[password] => 3c1175c6cdf614fb006cee10fdc325e3aa0f1894
[site] => Array
(
[0] => www.pro-net.co.uk
[1] => www.example.com
)
)
$this->user->site::
Array
(
[0] => simplexml_element Object
(
)
[1] => simplexml_element Object
(
)
)
$this->user->site[0]::
simplexml_element Object
(
)
[[END]]
Shouldn't $this->user->site return the Array displayed in the output for $this->user or even shouldn't the simplexml_element Objects for $this->user->site have a value or something. Basically they shouldn't be blank otherwise how to you get the data?