Reputation: 2749
I made this stupidly simple PHP file containing
<?php
class stuff {
private $var;
}
?>
and results in this error when run:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in . . . on line 4
To make things even more confusing, it functions normally on a different domain with the same host. Surely the folder and domain have nothing to do with whether class properties can be defined. What is going on here??
Upvotes: 1
Views: 96
Reputation: 4325
It looks like php4.
put
<?php phpinfo();>
into a file and view it from a web browser. That will let you determine the version.
Upvotes: 1
Reputation: 48569
You mean a different domain hosted on the same server? It could be an error with your php installation.
Upvotes: 0
Reputation: 522024
Seems like PHP 4 is active on that particular domain/folder of yours.
Upvotes: 2
Reputation: 97815
That's legal PHP code. I'd guess you're testing it in a machine that has PHP 4 installed. Support for PHP 4 has been discontinued for a long time; it's strongly recommended to upgrade.
Upvotes: 6