Re: Unexpected results with object to array cast
| From: | Francisco M. Marzoa Alonso | Date: | Wed, 03 Nov 2004 11:46:37 +0000 |
| Subject: | Re: Unexpected results with object to array cast | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201011@lists.php.net to get a copy of this message | ||
Forget it, it has a lot of sense since self is a reference to the object
itself, but the new array is not in the same memory than the source
object, so result cannot be as I expected because self is no really
"self" within the array, but a reference to an object outside it.
The result its perfectly logical, indeed.
Francisco M. Marzoa Alonso wrote:
Produce the following output: TestClass Object ( [self:private] => TestClass Object *RECURSION* ) Array ( [ TestClass self] => TestClass Object ( [self:private] => TestClass Object *RECURSION* ) ) While I expect to find for the second line something more similar to: Array ( [self:private] => TestClass Object *RECURSION* ) Can someone explain me what I'm doing wrong? P.S. Die Reischtag Brände