I an getting the following error:
PHP Parse error: parse error, unexpected T_STRING in errtest.php on line 7
The code is a sample from w3schools:
-
<?php
-
//create function with an exception
-
function checkNum($number)
-
{
-
if($number>1)
-
{
-
throw new Exception("Value must be 1 or below");
-
}
-
return true;
-
}
-
-
//trigger exception
-
checkNum(2);
-
?>
-
I am using php5 and developting on Javascripteditor