Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82569 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4404 invoked from network); 12 Feb 2015 23:33:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 23:33:29 -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.212.181 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:51537] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/D4-15420-7483DD45 for ; Thu, 12 Feb 2015 18:33:28 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so8321431wiv.2 for ; Thu, 12 Feb 2015 15:33:24 -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=nyTaLM6SMmBe8OrQ7fXI7VVq0MV7p0a0/R4APAI5FLc=; b=gI66HRBRXwj8SKatcsilQvOGAl4WRnVx44LijKdWtYABrAbWQc3C1xHkLdH2wQGfdd rJXxhf9phDtwQiQO+YrnQtUtFOyp1PpIjFEis3DnwvPRMZkf7L+xM8qLPRqpoFNMFLqy 7gBPlTmyI2D8ZQvHLq4xaZMgZ5C0PxCyOwanbnO55DErBgMZtrT4LNvBD6I8DDgfscnD xzg33RnJwbvMb2LC3ORD411L1VByp1cc02xRIlD8ESJqEPLiVmxB+j9eL50To6tEbFnS Fsf4tAil+9wwERyv4mjmKX4Xai74qCwT9HSwyxLVoHPbjlRhyZX6GBBSLMhfjb6f4rK3 phbg== MIME-Version: 1.0 X-Received: by 10.180.198.240 with SMTP id jf16mr10861528wic.27.1423784002755; Thu, 12 Feb 2015 15:33:22 -0800 (PST) Received: by 10.27.10.168 with HTTP; Thu, 12 Feb 2015 15:33:22 -0800 (PST) In-Reply-To: References: <54DCD8B7.40700@gmail.com> Date: Fri, 13 Feb 2015 00:33:22 +0100 Message-ID: To: Ferenc Kovacs Cc: Rowan Collins , PHP internals Content-Type: multipart/alternative; boundary=047d7b66f6dbb8a247050eec8b6d Subject: Re: [PHP-DEV] Remove $this from incompatible context From: nikita.ppv@gmail.com (Nikita Popov) --047d7b66f6dbb8a247050eec8b6d Content-Type: text/plain; charset=UTF-8 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. Nikita --047d7b66f6dbb8a247050eec8b6d--