Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63680 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92489 invoked from network); 28 Oct 2012 02:41:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2012 02:41:18 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.26 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.26 out2-smtp.messagingengine.com Received: from [66.111.4.26] ([66.111.4.26:40174] helo=out2-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/11-18930-D4B9C805 for ; Sat, 27 Oct 2012 22:41:18 -0400 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 82F8A2042F for ; Sat, 27 Oct 2012 22:41:15 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 27 Oct 2012 22:41:15 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=NQkTSCtO0i7UGXTNkyncBw gpQ5g=; b=ZnCuzobMyCJWIIpzhegMnmGIX5XHWJQ8qSztwF1H5mb5EIfkTWYeW4 QBr1jn4x9cCyU57AWpKB86d+HCCuKrNUdETBePIGUgtNxQ4In34JkCCiVX6+Z8/m 7JjT0UjMBD5WNtt+WlBjdxuZ1EciXdZpsx8kU7CXkEdeyof8zhiD4= X-Sasl-enc: udzH4EPRCARSZF9V9jU+OobvQWfBJDxb7vaYGpnhXAhT 1351392075 Received: from [192.168.42.21] (unknown [98.220.238.115]) by mail.messagingengine.com (Postfix) with ESMTPA id 211EE482642 for ; Sat, 27 Oct 2012 22:41:15 -0400 (EDT) Message-ID: <508C9B4A.5090801@garfieldtech.com> Date: Sat, 27 Oct 2012 21:41:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: internals@lists.php.net References: <508A695F.8080308@zerocue.com> In-Reply-To: <508A695F.8080308@zerocue.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : Extra shorthand declaration From: larry@garfieldtech.com (Larry Garfield) On 10/26/2012 05:43 AM, Clint Priest wrote: > I'm opening up several new threads to get discussion going on the > remaining "being debated" categories referenced in this 1.1 -> 1.2 > change spec: > https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented/change-requests > > > ------------------------------------------------------------------------ > *Extra shorthand declaration* > > Allow extra short declaration of an accessor: > > class TimePeriod { > public DateTime $date; > } > > /* Would be equivalent to this */ > > class TimePeriod { > public $date { > get() { return $this->date; } > set(DateTime $value) { $this->date = $value;} > } > } > > ------------------------------------------------------------------------ > Thoughts? > My knee-jerk response is that I'd love to be able to do public DateTime $date; it's nicely self-documenting and gives me very simple type safety (and therefore a clear and useful error thrown in my face, rather than a mystery bug later). That said, I think that goes back to my mental model question in my previous post, and I can't fully endorse this without knowing my mental model. --Larry Gafield