PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
class foo {
public $cheese;
function foo(){
$this->cheese['eek'] = new bar();
}
}
class bar {
function test(){
echo 'in test';
}
}
$v = 'eek';
$temp = new foo();
$temp->cheese[$v]->test();
PHP5's __get function might help but i couldn't get it to work exactly as you wanted.
Its ok, i gave up on the Object referencing a pass by reference array. I think the memory location got screwed up and i am lazy to figure out the error.