I'm attempting to throw an exception using php 5.3.2 and it is giving me the following error:
Parse error: syntax error, unexpected T_THROW
I am attempting to throw an exception the following way:
throw new Exception('Property ' . $name . ' doesn\'t exist in class Index', '');
Edit: I also tried
throw new Exception('Property ' . $name . ' doesn\'t exist in class Index');
it didn't change the error I was getting.
The complete method:
public function __get($name)
{
if(property_exists($this, $name)
throw new Exception('Property ' . $name . ' doesn\'t exist in class Index');
return $this->$name;
}