$name
and $mat
get null
values (they're not defined). You get nothing returned because there is nothing to return...they're null
.
if($a->getName() == NULL)
print "Alumn->name is NULL";
if($a->getMat() == NULL)
print "Alumn->mat is NULL";
See the following for output: http://ideone.com/lcuSNB