Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82544 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5350 invoked from network); 12 Feb 2015 16:46:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 16:46:37 -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 74.125.82.48 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wg0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:37409] helo=mail-wg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/A9-50473-AE8DCD45 for ; Thu, 12 Feb 2015 11:46:35 -0500 Received: by mail-wg0-f48.google.com with SMTP id l18so8241473wgh.7 for ; Thu, 12 Feb 2015 08:46:29 -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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=FE+u5S/vl4hJS1eR8R8GCC1dtwxXiBy4R3tr89WvvKo=; b=TG5JeIIVT/ZcvQv7n+Cu9m1yxYwYbHAlFPE3kt/pSF9rAFl1VmoIlUF5WC3Xm3YIGC k/+Rn+u+ZcXs8MwWSuD8jkVKa7rWyDKSpGcfyI04hI08FAgpsO/74a2Xk06FkC0MbdAU gQZPbQ01TJnU0tUSKqCXSdd8ayAAdvvxLV1CI8iC/VvkIOjUf/ErpbtB6sPq9zFamV+8 aducw0l85H83ZjPx5FeupOgqTbSpW2JJctz1e7FxvlZuzkV91oPhMN1IOk1o7Y5GQMHn hFYXrM67IfrrN5KnopbGFNMbaY69Iev7t3dNeMl5RjP1cWHudfuXyryT7qoYxGsYJ/T8 mesg== X-Received: by 10.194.61.100 with SMTP id o4mr9895145wjr.28.1423759589654; Thu, 12 Feb 2015 08:46:29 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id n6sm6407035wjy.8.2015.02.12.08.46.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 08:46:28 -0800 (PST) Message-ID: <54DCD8B7.40700@gmail.com> Date: Thu, 12 Feb 2015 16:45:43 +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: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Remove $this from incompatible context From: rowan.collins@gmail.com (Rowan Collins) Nikita Popov wrote on 12/02/2015 14:24: > Hi internals, > > As part of [1] and [2] we have decided to remove support for doing static > calls to instance methods, if this would result in an incompatible $this > variable to be used. When applying [3] this change we found that the change > as originally intended may be too strict. [snip] > The compromise I'd like to implement instead is to only throw a fatal error > if $this is actually used in the called method and otherwise throw a > deprecation warning. Calls from instance methods, static methods and > functions will all be handled the same. [snip] I'm definitely in favour of this over completely forbidding such calls. The only thing I'd question is the use of E_DEPRECATED when the static call doesn't use $this. Is there actually any intent to change the behaviour in a future version? What is the advantage to doing so? It strikes me as rather like the case of "var" for properties, which had the deprecation notice removed. I think it would make more sense to raise an E_STRICT, since the main purpose seems to be to discourage users making such calls. Regards, -- Rowan Collins [IMSoP]