i've declared the next class:
class Background{
protected $users = array() ;
......
}
and I employ $users as array of User() , which is another object i've created.
The problem comes up when I try to use this method :
function createB(){
foreach($this->users as $user){
$name = $user->getName();
}
}
And $user->getName() is actually an error becuase $user is not seen as an object.
What might be the reason for this ?
Thanks in advance
User?$useris the just internal array pointer.