Maybe the question is a little confusing, lets use an example:
Let's say I have an object (class) of Team.
Inside the class I have a class property which is an object (class) of Player and I want to access his jerseyNumber property, how do I do this?
class Team {
public $player;
}
class Player {
public $jerseyNumber;
}
Bare in mind, I'm new to PHP.
To access a property inside Team, I would just use:
$team->player;
But it doesn't seem like I can access a property inside player like this (which I'd think would work considering the above):
$team->player->jerseyNumber;
So how do I access jerseyNumber?