Re: SimpleXML behaves like chameleon

From: Date: Mon, 31 Jan 2005 21:59:08 +0000
Subject: Re: SimpleXML behaves like chameleon
References: 1 2 3  Groups: php.xml.dev 
Request: Send a blank email to php-xml-dev+get-528@lists.php.net to get a copy of this message
On 31.1.2005 22:46 Uhr, Jirka Kosek wrote:
Christian Stocker wrote:
Simple answer, the usual array functions don't work on simplexml objects. Use the iterator interface.
OK, I can uderstand to this. But it still unclear to me why some properties of objects returned by SimpleXML are one time typed as array and second time as an object. Maybe it is because SimpleXML tries to make things simpler than they are ;)
You can't rely on print_r. It's of no value, what that says, so don't try to interpret that ;) (the same goes for var_dump, btw). The iterator interface (foreach et al.) will do the correct thing for you.
BTW: Do you have idea when PHP 5.1 will be out (even on RC level)? Many XML things (like namespace bindings and XPath issues) should be fixed in this release.
No, no idea. chregu
                Jirka
-- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB

« previous php.xml.dev (#528) next »