Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94262 invoked from network); 25 Sep 2016 17:09:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2016 17:09:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.220 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.220 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.220] ([81.169.146.220:37984] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/29-11573-3E408E75 for ; Sun, 25 Sep 2016 13:09:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1474823393; l=4653; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=1gsuqdaQuUgDLty5KP6CfXVwC/Sp/b24irmPzb9bjwI=; b=d6HyKRX8HFMqD0tD2f1nDqgIsf1+Ak4k69/oryOW1x8SGrcyNifXYPJC3kav4EdHHTI 6vR2n6bRedQKKlOheoA6LGnKjkCJGidsqCDLc7g3tAfh7kLKsQFl3jndun0kA+Td0GWfG oAtPbYtUm9wIIRWjfgb8zX7i5OEzKyfDspE= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3s6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f48.google.com ([74.125.82.48]) by smtp.strato.de (RZmta 39.3 AUTH) with ESMTPSA id n0b547s8PH9qJWm (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sun, 25 Sep 2016 19:09:52 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id w84so113159074wmg.1 for ; Sun, 25 Sep 2016 10:09:52 -0700 (PDT) X-Gm-Message-State: AA6/9Rme926OqBYC9/ylhO9soHNBDo11oV0ZJjDlqLqTbjnUuY/QYgbuHvZ0C5WDv+ACMVV61Ix19ZI3Y0XMug== X-Received: by 10.28.238.144 with SMTP id j16mr11983223wmi.10.1474823392848; Sun, 25 Sep 2016 10:09:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.125.132 with HTTP; Sun, 25 Sep 2016 10:09:52 -0700 (PDT) In-Reply-To: <006d8ac3-df7d-8890-5b60-56fbc9e856b1@gmx.de> References: <006d8ac3-df7d-8890-5b60-56fbc9e856b1@gmx.de> Date: Sun, 25 Sep 2016 19:09:52 +0200 X-Gmail-Original-Message-ID: Message-ID: To: "Christoph M. Becker" Cc: Leigh , Pierre Joye , Dan Ackroyd , PHP internals Content-Type: multipart/alternative; boundary=001a11476d7e6ffab1053d581443 Subject: Re: [PHP-DEV] [VOTE] get_class() disallow null parameter From: me@kelunik.com (Niklas Keller) --001a11476d7e6ffab1053d581443 Content-Type: text/plain; charset=UTF-8 2016-09-25 15:19 GMT+02:00 Christoph M. Becker : > On 25.09.2016 at 11:29, Leigh wrote: > > > On Sun, 25 Sep 2016 at 06:29 Pierre Joye wrote: > > > >> Also this behavior is clearly documented: > >> > >> http://th1.php.net/manual/en/function.get-class.php > >> > >> "If object is omitted when inside a class, the name of that class is > >> returned." > >> > >> I am opposed to break BC because we change our mind about how clean is > this > >> behavior and I recommend the (future) RMs to veto this change. > > > > This is ambiguous at best. > > > > "Omitted" and "Not omitted but set to null" are different things. > > However, the changelog entry for 5.3.0 states: > > | NULL became the default value for object, so passing NULL to object > | now has the same result as not passing any value. > > And that's what I would expect when reading the function signature; > after all, NULL is the default value of $object. I think what matters is the documentation of the return value, not the changelog. Returns the name of the class of which object is an instance. Returns FALSE > if object is not an object. > If object is omitted when inside a class, the name of that class is > returned. It clearly says "omitted", that's passing nothing at all. Passing `null` doesn't omit an argument, it passes `null`. I am opposed to break BC because we change our mind about how clean is this I guess most code that might pass null is probably broken, do you have a use case where the current behavior even makes sense? Regards, Niklas --001a11476d7e6ffab1053d581443--