Hello Masoud,

Sunday, July 20, 2003, 5:52:12 PM, you wrote:

M> It's just a suggestion to have a syntax like this in PHP5!

M> A property is similar to a field (a member variable), with the exception
M> that there is a getter and a setter
M> method, as follows :

M> public class Car
M> {
M>     private string make;
M>     public string Make
M>     {
M>         get { return make; }
M>         set { make = value; }
M>      }
M> }

M> Car c = new Car( );
M> c.Make = "Acura"; // use setter
M> String s = c.Make; // use getter

M> above example is a simple C# example in NET Framework Essentials.

Other languages support this too.

Have a look a __get and __set.


-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to