I want to create an array within an object (handler) that holds a series of objects (subject) in PHP. The array is a property of the handler and I have a method to create new subjects.
class MyHandler (
$TheList = array();
$TempSubject = object; // class subject
public function AddNewSubject($information) {
$TempSubject = new subject($information);
$This->TheList [] = $TempSubject;
}
)
If I create a new subject as above, does the information persist object persist within MyHandler or is it lost after AddNewSubject ends? I am new to PHP so please comment on any errors.