Re: Object Array?

From: Date: Thu, 18 May 2006 22:47:12 +0000
Subject: Re: Object Array?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-236448@lists.php.net to get a copy of this message
Richard Lynch wrote:
On Thu, May 18, 2006 1:25 pm, Jay Paulson wrote:
I tried with no success yesterday to get an answer to this question so I'll try again. I have an object from using simpleXML and inside that object is an array holding even more objects. However, it's not acting like an array and therefore I can't go through it. (i.e. I can't use the count function to see how big it is and loop through it) This below should be an array: $xml->RES->R
Just for fun, try using $xml['RES'] to get $res, and $res['R'] to get $r and see what $r is. I don't see *HOW* they could manage to override the -> operator (unlike C++) but maybe they hacked it somehow... Guess simpleXML isn't looking quite so simple anymore, eh? :-^
its (simpleXML) a blooming oxymoron! but do note that implmenting the Iterator interface in a userland class doesn't have the same [nightmarish] affect in print_r()/var_dump(), in such cases you just get a 'normal' dump of the object in question. simpleXMLElements (or whatever they are called) are from my experience rather 'unique' with respect to trying to dump them in order to figure out how they are built up - i.e. you can't


« previous php.general (#236448) next »