Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50690 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34706 invoked from network); 29 Nov 2010 14:23:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2010 14:23:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:61974] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/04-09925-657B3FC4 for ; Mon, 29 Nov 2010 09:23:19 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 758725D18; Mon, 29 Nov 2010 09:23:16 -0500 (EST) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EQVfNnc9r2Vo; Mon, 29 Nov 2010 09:23:16 -0500 (EST) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id EE5D75D16; Mon, 29 Nov 2010 09:23:15 -0500 (EST) To: , References: In-Reply-To: Date: Mon, 29 Nov 2010 09:23:14 -0500 Message-ID: <003601cb8fd0$f6494e80$e2dbeb80$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuPUq1urQcgDVRWSoOEfenzX82K2QAdBwtQ Content-Language: en-ca Subject: RE: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP From: jbondc@openmv.com ("Jonathan Bond-Caron") On Sun Nov 28 06:18 PM, president@basnetworks.net wrote: > > Link to the RFC: > http://wiki.php.net/rfc/propertygetsetsyntax > 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; } Would favor re-use similar to traits by injecting the set/get code around the property.