[PHP] Problem with Object references in an array via for loop

2008-05-29 Thread David Moylan
I have a snippet of code like this which works fine in PHP4. $secs = array(); foreach($_GET['sids'] as $sid){ $secs[$sid] = new CustomSecurity(); $secs[$sid]->set(array('customSecurityID' => $sid)); } However, in PHP5 (5.2.4) the array has the proper keys in it but all of the array values

Re: [PHP] Problem with Object references in an array via for loop

2008-05-29 Thread David Moylan
arrays saludos On Thu, May 29, 2008 at 1:31 PM, David Moylan <[EMAIL PROTECTED]> wrote: I have a snippet of code like this which works fine in PHP4. $secs = array(); foreach($_GET['sids'] as $sid){ $secs[$sid] = new CustomSecurity(); $secs[$sid]->set(array('customSe

Re: [PHP] Problem with Object references in an array via for loop

2008-05-29 Thread David Moylan
ill researching about this On Thu, May 29, 2008 at 2:08 PM, David Moylan <[EMAIL PROTECTED]> wrote: Nope. Same performance. I originally had something like this (minus the assigment to null) but I thought the confusion was in the variable assignment so I went directly to the array. I've t

Re: [PHP] Problem with Object references in an array via for loop

2008-05-29 Thread David Moylan
Solved this. I tried setting a class variable directly and didn't have the same issue (should have tried that long ago). So that told me that my error was somewhere in some lower level code when I initialize my objects. I tracked it down to a problem where I wasn't cloning properly when I ne

Re: [PHP] Problem with Object references in an array via for loop

2008-05-29 Thread David Moylan
o $sec = $secs[$sid]; in the loop $sec refers correctly to object instances without the need to unset it. Thanks again. Dave David Moylan wrote: Solved this. I tried setting a class variable directly and didn't have the same issue (should have tried that long ago). So that told me t