Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74799 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66051 invoked from network); 9 Jun 2014 14:12:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2014 14:12:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.178 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.178 mail-ob0-f178.google.com Received: from [209.85.214.178] ([209.85.214.178:56332] helo=mail-ob0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/13-45325-0E0C5935 for ; Mon, 09 Jun 2014 10:12:49 -0400 Received: by mail-ob0-f178.google.com with SMTP id wp4so1962695obc.9 for ; Mon, 09 Jun 2014 07:12:46 -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; bh=Z3yKUkfqUGRgApfCosS1KIg7TB8jIoRNV/8gLk03BwI=; b=k5blZW7/tGjLn85uInI/wXzj1JivmEUYkyQQa/8OM4Ji/yYQZt8js75pTNzrZC5CyE XQ1G7EIg5DC3+kYs/FKL7ZEZn514/x5JSFArCfnptMFNqsivMcy1FaTzBmoB84wKQyVj r/O3rLg/nTbotUIuoWnfDfoxCCwr13TSvNkd0ECcPPJOA0AS0eHHwdm/+5OntsylJ5cM inWYZJTYtJMcQci7vZ17bn4rvghe+beoVTK2gpAYuVSTeBL5Cakq60kExtSI13tKXoH6 WFW/sbvGcRC8YhbykhefXGuQFgMPtaTYt+C2Zo9Ds8k5qbRlwL02JbHZTsr8A8fjsBXl Skeg== MIME-Version: 1.0 X-Received: by 10.182.247.40 with SMTP id yb8mr24931261obc.38.1402323165880; Mon, 09 Jun 2014 07:12:45 -0700 (PDT) Received: by 10.182.165.69 with HTTP; Mon, 9 Jun 2014 07:12:45 -0700 (PDT) In-Reply-To: <45A8B0C0-52D1-4E4C-A314-4396B6FD635E@ajf.me> References: <45A8B0C0-52D1-4E4C-A314-4396B6FD635E@ajf.me> Date: Mon, 9 Jun 2014 16:12:45 +0200 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: multipart/alternative; boundary=089e0149464629a76f04fb67ced0 Subject: Re: [PHP-DEV] [RFC] [PHP 6] Uniform Variable Syntax From: nikita.ppv@gmail.com (Nikita Popov) --089e0149464629a76f04fb67ced0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 9, 2014 at 3:45 PM, Andrea Faulds wrote: > > On 9 Jun 2014, at 14:33, Nikita Popov wrote: > > > I have created a proposal for a more consistent and complete variable > > syntax for PHP 6: > > > > https://wiki.php.net/rfc/uniform_variable_syntax > > > > The RFC is targeted at PHP 6 because it breaks compatibility for some > > rarely used variable-variable constructs. > > I love this proposal! The behaviour of $$ is non-intuitive at present and > has bitten me more than once, and the weird behaviour of :: has also caus= ed > me problems. In particular, my miniature web framework didn=E2=80=99t wor= k properly > due to this line: > > self::$views[$path](); > > It=E2=80=99s easy to fix ($x =3D self::$views[$path]; $x();) but the fact= that > didn=E2=80=99t work has bothered me immensely for two years. It seems to = me like > the RFC would fix this. Would it? If so, you are my hero. > Yes, it would ;) > On a somewhat more serious note, do we have any idea of how much code thi= s > would break? Is the current behaviour widely relied-upon? > Quoting https://wiki.php.net/rfc/uniform_variable_syntax#backward_incompatible_chan= ges : > An analysis of the Zend Framework and Symfony projects > (including standard dependencies) showed that only a single > occurrence of $loader[0]::$loader[1]($className) in the Doctrine > class loader will be affected by this change. So I think that this will not break much code. It is also easy to detect and fix. (I am using this script to find potential problems: https://gist.github.com/nikic/ffd019ef78b72934c7cc) Nikita --089e0149464629a76f04fb67ced0--