NYCPHP Meetup

NYPHP.org

[nycphp-talk] Trouble with Array of Objects

Chris Snyder chris at psydeshow.org
Tue May 27 17:29:16 EDT 2003


You've probably figured out as much, but *something* is reseting 
$meetings on every foreach loop.
V. strange. It's as if $mettings = array ( ); was actually inside the 
foreach.


Christopher R. Merlo wrote:

>On 2003-05-27 17:10 -0400, Chris Snyder <chris at psydeshow.org> wrote:
>
>  
>
>>Scratching head... have you tried $meetings[] = new Meeting ( etc.); ??
>>Not that it should matter, of course.
>>    
>>
>
>Oddly, that changes the "[4]" below:
>
>  
>
>>>Array ( [4] => meeting Object ( [day] => Friday [start] => 08:00:00
>>>[end] => 10:50:00 [dept] => CMP [course] => 218 [building] => B [room]
>>>=> 113 ) ) 
>>>      
>>>
>
>to a "[0]", but it's still the same object stored (the last one of the
>five).
>
>  
>
>>Also, are you PHP 4.3.1? (And not 4.3.2RC4?)
>>    
>>
>
>I'm actually (gasp!) at 4.1.1.  I was planning to update the box (OS,
>PHP, etc.) before summer session started, but alas, I was too lazy.  I
>wonder if the old version of PHP makes a difference.
>
>  
>


-- 
do you have a photoblog yet?
http://fotola.com  (help beta-test!)





More information about the talk mailing list