Re: private, public, protected in 4.3.11
| From: | Aaron Koning | Date: | Thu, 12 Jan 2006 07:55:33 +0000 |
| Subject: | Re: private, public, protected in 4.3.11 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-228516@lists.php.net to get a copy of this message | ||
"exception, final, php_user_filter, interface, implements, extends, public,
private, protected, abstract, clone, try, catch, throw" where not introduced
until PHP 5 (http://ca3.php.net/reserved).
Therefore, var is the only way to define member variables prior to PHP 5.
Aaron
On 1/11/06, Peter Lauri <peter@lauri.se> 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?
>
>
>
> /Peter
>
>
>
>
>
>
>
>
>