|
Posted by Michael Fesser on 07/13/07 16:21
..oO(Ryan Govostes)
>Consider this cde:
>[...]
>
>echo getInstance()->value;
>/**********/
>
>In PHP5, this correctly echos '6'. However, in PHP4, I get
>
>Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ','
>or ';' in /test.php on line 16
PHP 4 doesn't support this syntax.
>I do need to the code in this format, without splitting it into two
>lines (which I know works). It would be detrimental to my project if
>it turns out this won't work at all :-\
If you really want to use OOP and its features, then drop PHP 4 and use
PHP 5.
PHP 4 is reaching its end of life this year (see <http://www.php.net/>),
while PHP 6 is going to see the light of day in maybe a few months.
Micha
Navigation:
[Reply to this message]
|