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:
I am using php5 and developting on Javascriptedito r
PHP Parse error: parse error, unexpected T_STRING in errtest.php on line 7
The code is a sample from w3schools:
Code:
<?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);
?>
Comment