Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95181 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40243 invoked from network); 15 Aug 2016 10:38:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2016 10:38:11 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:55748] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/BF-36656-19B91B75 for ; Mon, 15 Aug 2016 06:38:10 -0400 Received: from [192.168.2.103] ([79.243.112.54]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0M6eTo-1bEGUL3ubM-00wTMq; Mon, 15 Aug 2016 12:38:06 +0200 To: Stanislav Malyshev , Dan Ackroyd , "internals@lists.php.net" References: <0d1e3cfc-f5df-474d-f8dc-c806bec0e412@gmx.de> <3e7c038b-0e1a-bf7e-c3bf-46594bf13157@gmail.com> Message-ID: <2f759ec3-4207-1541-4f5f-9080e9f2cbbe@gmx.de> Date: Mon, 15 Aug 2016 12:38:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <3e7c038b-0e1a-bf7e-c3bf-46594bf13157@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Xek781v6kpFvO2SuGI5eijPPIvnK3mxgHacC2YyYFsGBVuLPCMw SarSGCK5ddRVHlgIwmqgk73UT6K2tRxhCT3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("Christoph M. Becker") On 15.08.2016 at 02:09, Stanislav Malyshev wrote: >> Prohibiting `get_class(NULL)` is certainly a good idea, but I have some >> concerns regarding BC. While `__CLASS__` has been introduced with PHP >> 4.3.0, it had the glitch to return the lower-cased class name before PHP >> 5.0.0. So there *might* still be PHP 5 code around using `get_class(NULL)`. > > I note that this (i.e. behavior proposed in the RFC) was briefly the > case for 5.3.0 and was changed to current behavior for 5.3.1. But > pre-5.3 versions return false when NULL is passed to get_class, with no > message. > > So, old PHP code doesn't seem to be a problem only one that was written > after 5.3.1, because it doesn't look like get_class(NULL) worked before > it: https://3v4l.org/4QvCs Thanks for pointing this out. Interestingly, indicated by a changelog entry in the get_class() manual, the behavior is somewhat different when no argument is passed, see . That works as least as of PHP 5.2.0; not sure why 5.0 and 5.1 fail here. As the proposed behavior had been introduced with 5.3.0 and reverted shortly after, indicates that we should be careful here. Deprecating for 7.2 and removing with 8.0 seems to be the safer way. -- Christoph M. Becker