Im having a bit of trouble with my first class. The code is very simple and follows below.
#############(teststatic.php)##################
<BODY>
<?
require("static_class.inc");
$first = new Static;
$firsttest = $first->returnValue ("1");
if($firsttest) {
echo "IT IS TRUE";
} else {
echo "IT IS FALSE";
}
?>
</BODY>
######## HERE IS THE CLASS (static_class.inc)##########
<?
class Static {
function returnValue ($val) {
if ($val == 5) {
return true;
} else {
return false;
}
}
}
?>
####################################
I keep getting the error
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `'$'' in /export/home/sites/nsa/home/chuff/teststatic.php on line 5
I've messed around with it alot, read just about every tutorial on the subject of classes but I cant seem to get it to work. What the heck am I doing wrong here?
CH