Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63494 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16430 invoked from network); 17 Oct 2012 11:00:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2012 11:00:25 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:41765] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/E6-64689-6B98E705 for ; Wed, 17 Oct 2012 06:34:31 -0400 Received: by mail-lb0-f170.google.com with SMTP id gm13so5090828lbb.29 for ; Wed, 17 Oct 2012 03:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=U8qFwG9psIgMDnEdA8BRX1lYLGp21EemwnhL1qDOc1k=; b=DyRvw5GvHk69AfWCb22k2JIRXNZFtvOiEG6x5d2pXRn+q5KfU8w6Z7KQIlijVLPMVD jD0xeFlrSp4pB/4S8ROfK0ja4LYEDsC+enu/wwCQVytZEKMKJBDWHcUmAiPd4NqIvmmE TxA2piqXQeqfyhACZUGhvhutDMenEs78evnj9QcK6q2MqiY0lG7x+yRV9GH0022YEQcP 32kxVja+v/D/gKOTiKNqQ8IqvmbR5EYmUZAS3zEzB8o2P8UjUpyggtZZYmIVBQBJR/n5 +SsPWeDG+vX4tv91LaNH8X3vn20vRMY9h4kS8wZjWYUFhIQ5o5ieW4gMsbaJyHW5/yFw bovA== MIME-Version: 1.0 Received: by 10.112.87.97 with SMTP id w1mr4212780lbz.77.1350470067412; Wed, 17 Oct 2012 03:34:27 -0700 (PDT) Received: by 10.112.83.100 with HTTP; Wed, 17 Oct 2012 03:34:27 -0700 (PDT) In-Reply-To: <9570D903A3BECE4092E924C2985CE485612B6434@MBX202.domain.local> References: <9570D903A3BECE4092E924C2985CE485612B6434@MBX202.domain.local> Date: Wed, 17 Oct 2012 12:34:27 +0200 Message-ID: To: Clint Priest Cc: "internals@lists.php.net" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 : Typehints / Accessor Syntax From: nikita.ppv@gmail.com (Nikita Popov) On Mon, Oct 15, 2012 at 2:11 PM, Clint Priest wrote: > So the above would actually introduce an get/set accessor rather than a > property, correct? Preferably it would a faster C based implementation for the check, but in principle it could also use accessors to achieve the goal. > If we were to abandon the long form ( set(DateTime > $date) { ... } ) and go back to the original syntax, then the only way to > "type hint" would be with no custom accessor logic, which I don't think > makes sense. Why? My point was that you could use that syntax with accessors too, just like you can in C#: public DateTime $date { get { ... } set { ... } } I don't know whether this is better or worse though. I like it because it would be consistent between typehinted properties without accessors and typehinted properties with accessors. But I can see how people don't like the magic $value variable. > I can agree though that the even further abbreviated syntax -> get/set > accessor would be nice, however many have already pointed out that these > "equivalents" reduce clarity, especially for the less "up to speed" of th= e > developers. If they were to encounter that, they may have to really do s= ome > digging to realize that it=92s a "super auto implemented" accessor. They don't really need to know that they are auto implemented accessors (where would it make a difference?) Maybe they won't even be accessors. It's just an implementation detail. From looking at it, it's just a property with a type, just like you know it from C++, C#, Java or whatever. Nikita