I'm working on a website that creates an object called player that can contain any number of event objects that get added to the player object from an event-driven xml parser. So what I've been trying to do is use an array but that does not working, from my understanding this is because arrays must be constructed at object creation. So anyone have any alternative ideas or thoughts on what I missed?
<?php
class player {
//removed unrelated variables
var $attendance;
//removed unrelated functions
function player() { }
function addEvent(&$event) {
$this->attendance[] = $event;
}
}
?>