NYCPHP Meetup

NYPHP.org

Trouble with Array of Objects

Christopher R. Merlo cmerlo at turing.matcmp.ncc.edu
Tue May 27 16:45:53 EDT 2003


Folks:
This is probably easy, but it doesn't seem to work the way it does in
Java or C++.

I want to create five objects within a loop, and add them to an array.

Everything I try seems to place one object in the last (occasionally
the first) element of the array, but I never get the whole array
filled.  sizeof( $myArray ) continually returns 1.

However, I know the objects are getting created, because I have placed
a call to the "print yourself" function inside the constructor, so I
know five objects are getting created.

What am I doing wrong?
-c

-- 
cmerlo at turing.matcmp.ncc.edu        http://turing.matcmp.ncc.edu/~cmerlo

We're sorry, but the number you have dialed is imaginary.  Please
rotate your phone ninety degrees and try again.  Thank you.



More information about the talk mailing list