Reply to Re: Manipulating an object returned from function

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация