On Friday, April 5, 2002, at 03:00 PM, Brian McLaughlin wrote:
> My problem is that when I assign an empty array to a variable, I get > different results depending on whether that variable is in an object or > not. > In the case of assigning $a=array(); outside of an object, each element > of > the array is empty (as I expected). But when assigning > $this->$words=array(); results in $this->$words["Amy"] (or any other > element > for that matter) already being assigned an array. And if I look at the > elements of those arrays, they are also initialized to arrays. I don't > know > how deep it goes. Brian, Sorry to take so long to get back to you about this -- my inbox is very cluttered. The only thing I can think of is to ask you if you are sure you need the second buck in "$this->$words = array()" -- perhaps you have a reason for using a variable as the name of the class variable, but I would probably write it as "$this->words = array()". If that is not the source of your problem, re-post to the list and perhaps Lars Torben or one of the gurus will spot this idiosyncracy and have an explanation. or if you have already solved it, can you let me know what it was? I'm starting to do some object stuff in PHP and need to know about strange behavior like this. Regards, Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php