OK, and thanks for the quick reply.
My understanding is that arrays are of fixed dimension. So, to add to it you effectively have to create a new one and copy the contents across. Of course, there is built-in functions to do this but is it good for performance?
array_pop and array_push I assume are the functions to use.
How would I begin to implement this in my class?
I want $ListOfPlayers to be an array, but can I tell it that only instances of the Player class can be added? Perhaps I need to set my property as Private and then do some further code within my Squad class to check the type of object that is being added to ListOfPlayers and deal with it accordingly?
I believe I can use Type Hinting in my constructor?
class Squad
{
//Properties
public $Name;
public $Season;
public $Division;
public $ListOfPlayers;
}
//Contructor
function __construct($name, $season, $division, array $players) {
}
}