Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3517 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50502 invoked by uid 1007); 20 Jul 2003 16:36:50 -0000 Message-ID: <20030720163649.50501.qmail@pb1.pair.com> To: internals@lists.php.net References: <20030720155214.18238.qmail@pb1.pair.com> Date: Mon, 21 Jul 2003 00:36:47 +0800 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Posted-By: 61.6.127.159 Subject: Re: Property setter and getter in PHP5 From: jlim@natsoft.com.my ("John Lim") Hi Masoud, It's already available. See http://www.phppatterns.com/index.php/article/articleview/28/1/2/ "Masoud" wrote in message news:20030720155214.18238.qmail@pb1.pair.com... > It's just a suggestion to have a syntax like this in PHP5! > > A property is similar to a field (a member variable), with the exception > that there is a getter and a setter > method, as follows : > > public class Car > { > private string make; > public string Make > { > get { return make; } > set { make = value; } > } > } > > Car c = new Car( ); > c.Make = "Acura"; // use setter > String s = c.Make; // use getter > > above example is a simple C# example in NET Framework Essentials. > > > Masoud > >