You are here: Re: private, public, protected in 4.3.11 « PHP « IT news, forums, messages
Re: private, public, protected in 4.3.11

Posted by David Robley on 01/12/06 09:28

Peter Lauri wrote:

> Hi,
>
> Example code that I try to run in version 4.3.11:
>
> Class Page {
> private $myID;
> function Page() {
> $this->myID=1;
> }
>
> function getID() {
> return $this->myID;
> }
>
> }
>
> But I get error message:
>
> Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or
> `T_VAR' or `'}'' in C:\Documents and Settings\Peter Lauri\My Documents\DWS
> Asia\webserver\ework\classes\page.class.php on line 8
>
> If I change to
> var $myID;
> it works.
>
> What is wrong?

I think you will find that the Visibility feature you are trying to use was
introduced with PHP 5


Cheers
--
David Robley

I'm sure it's in the manual somewhere...

 

Navigation:

[Reply to this 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

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