Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10676 invoked from network); 4 Jan 2013 15:15:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2013 15:15:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.50 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.50 mail-oa0-f50.google.com Received: from [209.85.219.50] ([209.85.219.50:50425] helo=mail-oa0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/50-00128-D22F6E05 for ; Fri, 04 Jan 2013 10:15:58 -0500 Received: by mail-oa0-f50.google.com with SMTP id n16so14878653oag.23 for ; Fri, 04 Jan 2013 07:15:55 -0800 (PST) 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; bh=4nCYODvm7nvkwhr+tE+mz/e6aTiQAJ/vroakKpMN0mk=; b=Qc7PNySsyGVwIQy6rpl5XLpdLUFVO3gwUJrdwgIbnqurhPngr7Ve7rvpXvcMWow7K4 dVp5DjJP5uo7KWKLp39E74FNCpq31TAtbVmhpJg3S4yNjTVbZBwS6v/+5Nj25ot7CvD2 DfLoQOJfIf5V5rfXal0sA2CEZyGnMBDeMdHBI/nJaaoybSL6EtkNiTX7hnHFseT62A4w 3KnRnaqOGvhp9s2CbQo/6tcnU43ESTtsFqxeJ3JPOGQFI/qg6KWznht+r7fQzBYm9p4v HjuGZle/mp08pBJNWchubz2f5nmqWpIPFilae/rOlA1J3LJmPTKZgeVy+zYXHngUYzbo vuDg== MIME-Version: 1.0 Received: by 10.182.194.2 with SMTP id hs2mr39179163obc.97.1357312555123; Fri, 04 Jan 2013 07:15:55 -0800 (PST) Received: by 10.76.82.234 with HTTP; Fri, 4 Jan 2013 07:15:55 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Jan 2013 08:15:55 -0700 Message-ID: To: Nikita Popov , Clint Priest Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Alternative typehinting syntax for accessors From: morrison.levi@gmail.com (Levi Morrison) This proposal looks really good to me. It cuts out a lot of syntax and boilerplate for a commonly used case. However, there is one issue that I know somebody is going to raise: Argument: If you change the value of the property without using the setter then `get` could return something that has a type mismatch with the type-hint. If I understand the current RFC for properties correctly, the only place that a property can be directly written to without the accessor is inside of the `__setProperty` method. This almost nullifies the argument completely. The only other place for possible error would be assigning a value in the constructor that does not match the type-hint. However, because we adding a new syntax we *could* disallow assigning a value if it really was that problematic. I do not personally feel that would be necessary. I feel that this argument is not weighty enough to stop the proposal for this improved syntax.