/* klasa Student */
class Student {
   public $courses = array();
   // ... inne metody i (lub) wasnoci
}
/* uycie klasy Student */
$objStudent = new Student(1234); // konstruktor, nie podany powyej
foreach($objStudent->courses as $objCourse) {
   print $objCourse->name;
}