private, public, protected in 4.3.11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

 

 

 


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux