Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79501 invoked from network); 14 Aug 2016 23:34:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2016 23:34:01 -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.15.18 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:53789] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/85-36656-7EFF0B75 for ; Sun, 14 Aug 2016 19:34:00 -0400 Received: from [192.168.2.103] ([79.243.112.54]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0M8m7Q-1bTWzw0idA-00CEVX; Mon, 15 Aug 2016 01:33:56 +0200 To: Dan Ackroyd , "internals@lists.php.net" References: Message-ID: <0d1e3cfc-f5df-474d-f8dc-c806bec0e412@gmx.de> Date: Mon, 15 Aug 2016 01:34:06 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:yS7JsutcTuS6FQb43uL6+FD4eqNSqTHZxUYlzzs20bG1oBK7Xfj uQuauG80DKQ/BW/KAkuNa17w9AQC0SvWo9TAaFTQ2IsEcdgkjZdIA5UJQSXL8DJl2gYQbb4 jkLJ5UeoRx2kqpfZU8xze22p5S7oyUd9k1exKFE2unmDrhmMOhRZp6sSL5z98SItqtyynVc 98Nik6aBIbbkMm/cMwdRQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:bVtqC9VfGk4=:/9Kb6g1/cep595rE0aYkcM cHw0vlvR5yDC//PywJEnTC0RhimdkSa2C/dcCvgcwTABRVuWj3eoZCxzbvd2xYB8Isb7tJt6S MI+UgngM8Ngio4/h0TcyZMvVPLCin6yD8KGnoXRYh9F5HsI5lRMcsmkCC5oUL0M9kCj/K5ziy cVFitipUQyBUVLOF4r3PTmy2R1moA3Ye4jjBsxTHWi2CCE36tGW+TdvvmbslsEwvOgF13y5DW w5wrGbqEknIgFYzfI1I6PdDkB5ebfKVt+aaUPf8SFYMVXiwXTGegtO+NX2D3FZwkw5fgrOjs3 jxshUdHymPtsUMLxai4vHOf6Q36wNQ38uaf+KypiX5pC0NVGX+fDzCNl5PLCHEc2W328imj/P IzqIgbdNqw2kU+434nZU5B7f6m664lPaY8Z09iNYZLyZmDC2pRW0Cu8cxCzUo3OdxvlJiMO+r zz0GyG6Y1RiifsFN3EwSh5RUbfpPPmRvzZGPIGZMffyNHqCQ6P4S3Vabd8KbFaZ5rlTu86KLS Us6eR9W4j1eUREYuHUyGtp1OYP/BnTzfk9q3VM/FNtGdRPZSb5vr7MbsnfFfTPTqJBBJRCFXD h3VH/BRtKHVLw9JtMZO+HUQHSXPTGkHjMLLjLS/FQgYlfSbU4liovJro1at+X3L6qASCSiAuA gsodbzkMatgwzDC+FY+mWloBkmFRpZJKansF9jSuZw3GGjQbrSBY3/FtVEwNF32m2X44J5rbI VGElgsmQA8zO3ax/w7CtuVd5gX8kMFIoCJXfiUo32stpW/aQfYRx8EbN794eHzNSpJBxEuKeq 7iDYsXy Subject: Re: [RFC] get_class() disallow null parameter From: cmbecker69@gmx.de ("Christoph M. Becker") On 14.08.2016 at 13:00, Dan Ackroyd wrote: > Following an earlier discussion in January, here is a small RFC to > change get_class() to disallow null being passed as parameter. > > https://wiki.php.net/rfc/get_class_disallow_null_parameter > > Allowing null to be passed to get_class() is a 'gotcha' that is almost > always a mistake in someone's code. > > By preventing null being passed, get_class() will be far more likely > to do what people think it should do, and so result in fewer bugs in > code. > > This RFC is a small change and so is appropriate for a point release. > Other ways of making this function behave as people expect it to are > not as small changes, and are probably not appropriate for point > releases. 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)`. The deprecation might be more appropriate, and could equally well catch an inadvertent `get_class(NULL)`. -- Christoph M. Becker