Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36386 invoked from network); 29 Nov 2010 14:27:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2010 14:27:59 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.133 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.133 smtp133.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.133] ([207.97.245.133:57264] helo=smtp133.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/54-09925-E68B3FC4 for ; Mon, 29 Nov 2010 09:27:59 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp43.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 7CC792D05A6; Mon, 29 Nov 2010 09:27:56 -0500 (EST) X-Virus-Scanned: OK Received: by smtp43.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E22B12D0759; Mon, 29 Nov 2010 09:27:34 -0500 (EST) Message-ID: <4CF3B855.5010406@sugarcrm.com> Date: Mon, 29 Nov 2010 15:27:33 +0100 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Jonathan Bond-Caron CC: "president@basnetworks.net" , "internals@lists.php.net" References: <003601cb8fd0$f6494e80$e2dbeb80$@com> In-Reply-To: <003601cb8fd0$f6494e80$e2dbeb80$@com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Nice RFC, just an idea for an alternative syntax (added to the RFC as #2): > > property Hours { > get { return $this->seconds / 3600; } > set { $this->seconds = $value * 3600; } // The variable $value holds > the incoming value to be "set" > } > > class TimePeriod > { > private $seconds; > > public [Hours] $hours1; > public {use Hours;} $hours2; > } If you change "property" to "class" or "trait" and "get" to "__get" you need almost no new syntax :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227