Re: [nyphp-talk] Array Reference Strangeness

2007-05-28 Thread Michael B Allen
On Mon, 28 May 2007 08:55:39 -0400 Flavio daCosta <[EMAIL PROTECTED]> wrote: > Remember from the php manual: References in php are not like C pointers. > (they are symbol table aliases) > > On 05/28/2007 12:20 AM, Michael B Allen wrote: > > > for ($i = 0; $i < 3; $i++) { unset($arr); >

Re: [nyphp-talk] Array Reference Strangeness

2007-05-28 Thread Flavio daCosta
Remember from the php manual: References in php are not like C pointers. (they are symbol table aliases) On 05/28/2007 12:20 AM, Michael B Allen wrote: > for ($i = 0; $i < 3; $i++) { > $arr = array("a$i"); > $top[] = &$arr; > $arr["key$i"] = "val$i"; > } So what that is saying is t

[nyphp-talk] Array Reference Strangeness

2007-05-27 Thread Michael B Allen
Hey, I'm having trouble with array references. Consider the following code: #!/usr/bin/php -q I want to be able to update elements in $arr after it has been added to $top. However, the assignment appears to make a copy (adding elements to $arr are not in the $arr added to $top). So I thought p