I created a file test.class.php containing the following code in a LAMP environment:
<?php
class MyClass
{
public var $variable;
};
$obj = new MyClass();
?>
When I run:
php myclass.php
from the command line, I get the error:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /path/html/_dev/classes/test.class.php on line 5
If I access the same file via the browser, I get no errors. Any suggestions on what might be happening?