> First some basic questions: > (1) Can you create an unitialised array ? do you mean:
$array = array(); // creates an empty array; > (2) Can an unitinialised array be a class member variable ? for( $i = 0 ; $i < 5; $i++) $array[] =& new User(); I think it should work. > > I have a class called "user" - which represents one row in a mySQL table > (also called user) > > I want to create a class called "userBag" - this class will contain an > array of "user" classes - the constructor for "userBag" gets an SQL > statement and uses this do decide which users to place in the userBag > > Maybe I'm going about this all worng, but is there some other way I can > store a variable number of classes (Such as a CObject class in MFC for > Visual C++) - i.e. is there soem other collection class/type I don't know > of ? > > Thanks, > > Martin. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]