Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82601 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90275 invoked from network); 13 Feb 2015 11:21:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2015 11:21:28 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:34058] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/65-62214-63EDDD45 for ; Fri, 13 Feb 2015 06:21:27 -0500 Received: by mail-wi0-f178.google.com with SMTP id em10so11275062wid.5 for ; Fri, 13 Feb 2015 03:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=APArZiJsnOqDxRhh0HILEQPOeUnIjPADve/uv8Ua+g8=; b=ZcQggiMpVzaVpebkkBwJdueFDVUVTEZhzOsTU4PBCBGkvDAswJHxImL6weDJ3q3f4v iyRC5WuDBdje+Fbegoo8iItvi4ijCEJpM/raPeshhCiCdA+2VuzKP9LLcyU2sLAvTatx XBbfNObRDyTdsy5QPndKVusfWb5wP4rkrxKK0eu5/ioBiSVShsrs6cVhc3uD0RoIKRGf fJh/aUKx7ImXnnMe1arhhcQx8M1IEbfQaIfU8Ktd5kbSQO8QPnF+FHNdzeUkHHJdzDCn qtaLTuLH8XdYVMNEPSrYq70IiNgqpKuFL7ZijUQbRQSXsePjdmVeUbguQWZyf2bJyc5N EwaQ== X-Received: by 10.181.27.165 with SMTP id jh5mr15136387wid.15.1423826483740; Fri, 13 Feb 2015 03:21:23 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id fa3sm2522796wib.17.2015.02.13.03.21.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 03:21:21 -0800 (PST) Message-ID: <54DDDE00.7000808@gmail.com> Date: Fri, 13 Feb 2015 11:20:32 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: <54DCD8B7.40700@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------060904070604060600060207" Subject: Re: [PHP-DEV] Remove $this from incompatible context From: rowan.collins@gmail.com (Rowan Collins) --------------060904070604060600060207 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Nikita Popov wrote on 12/02/2015 23:33: > On Fri, Feb 13, 2015 at 12:06 AM, Ferenc Kovacs > wrote: > > adding the E_DEPRECATED was only about the assuming $this > behavior: https://wiki.php.net/rfc/incompat_ctx > > > While the RFC may claim that, the way it was implemented will throw > E_DEPRECATED irregardless whether $this is used or not. As such all > static calls to non-static methods will currently throw a deprecation, > if the call happens from a non-static method. In practice you can > leave off that last restriction, because in codebases that don't use > "static" annotations for PHP 4 compatibility obviously all methods are > non-static, so always E_DEPRECATED will be thrown instead of E_STRICT. > > Reverting this to E_STRICT means we undeprecate this again, which is > something I am certainly against. > > and the original plan for removing this behavior was simply to > remove/not assume $this: > "Even though I think an error at call site would be the most > useful to the user, the most sensible option is to just have $this > === null inside the callee, like when you do" > > > The RFC is not very clear on what is supposed to be implemented. I'm > proposing to go with the option "most useful to the user" here, while > you suggest to use what's referred to as "the most sensible option". > > However, I am not willing to invest more time in this issue. I have > decided that I will implement this by nulling out $this and keeping > the error levels exactly as they are right now (a mix of E_STRICT and > E_DEPRECATED). I would have liked consistent error levels and I would > have really liked being nice to the user and giving him a error at the > call site, instead of a weird undefined variable notice which is even > suppressed by default. But in the end this is just not important > enough for me to put up with all the php internals crap. I'm sorry this discussion has become so frustrating for you. Personally, I think consistent errors would be great; and I agree that the aim should be to give the user a helpful notice. Whether that should be E_DEPRECATED or E_STRICT is a minor detail, and depends on us predicting the future. My personal prediction is that this will go the way of "var", and remain as a discouraged but supported feature, but it's really not that big a deal. Regards, -- Rowan Collins [IMSoP] --------------060904070604060600060207--