Re: [PHP] private, public, protected in 4.3.11

2006-01-12 Thread Aaron Koning
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 [EMAIL PROTECTED] 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











Re: [PHP] private, public, protected in 4.3.11

2006-01-12 Thread Zareef Ahmed
Hi Peter,

   Code you are using is for php version 5. That is one in only reason.
You need to install PHP version 5 to run this code or just do it as simple
$var type declaration.

Zareef Ahmed

- Original Message - 
From: Peter Lauri [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Thursday, January 12, 2006 1:28 AM
Subject: [PHP] private, public, protected in 4.3.11


 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









PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] private, public, protected in 4.3.11

2006-01-11 Thread Peter Lauri
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