For whatever reason, I have a small bit of PHP code that no matter where I put var $blah;, it always gives this error in the logs: PHP Parse error: syntax error, unexpected 'var' (T_VAR) in /path/to/file.php on line xx
I have no idea why it wouldn't accept this. A class that is included (which creates the $proverbSite variable in another php section) uses plenty of 'var $blah', with no problems. I also realise this is probably just an embarassingly simple mistake.
<?php
$proverbSite->dbConnect();
$result = $proverbSite->dbQuery("randProverb");
if($result != null) {
$row = $result->fetch_assoc();
echo $row['proverb'];
echo "<br>";
}
?>
line xx?;somewhere.var $x=1;outside of a class declaration.