Not tested, but what if you change $b[0] = new one(); $b[1] = new one();
to: $this->b[0] = new one(); $this->b[1] = new one(); On Tue, 3 Sep 2002, Rodrigo Dominguez wrote: > I have a problem, I can't create an array of classes into a class, for > example: > > class one { > var $a; > > function foo() { > echo "foo"; > } > } > > class two { > var $b; > > function initialize() { > $b[0] = new one(); > $b[1] = new one(); > } > } > > $test = new two(); > $test->initialize(); > > $test->b[0]->foo(); //It doesn't work > $test->b[1]->foo(); //It doesn't work > > Any suggestion? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php