Here’s a very bare class with one static method. I cannot for the life of me work out why it’s throwing the error:
Parse error: parse error, expecting `T_STRING’ in
C:…\error.php on line 7
This is the code:
<?php
# Error class to handle errors
class Error
{
# Function to throw an error - which redirects with error msg
public static function Throw($id, $dest) // line 7
{
System::Redirect($dest."&e=$id");
exit;
}
}
?>
Throw is a reserved keyword, therefore you cannot use it as a method name.
See http://www.php.net/manual/en/reserved.keywords.php