Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108989 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56055 invoked from network); 12 Mar 2020 00:05:07 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 12 Mar 2020 00:05:07 -0000 To: internals@lists.php.net References: <5e619238.1c69fb81.59711.d7b8SMTPIN_ADDED_MISSING@mx.google.com> Date: Wed, 11 Mar 2020 23:26:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 46.59.72.204 Subject: Re: [PHP-DEV] Make sorting stable From: ajf@ajf.me (Andrea Faulds) Message-ID: Hi Nikita! Nikita Popov wrote: > I've update the message to say: > >> Deprecated: usort(): Returning bool from comparison function is > deprecated, return an integer less than, equal to, or larger than zero in > %s on line %d > > The astute reader will notice that this is equivalent to "any integer", but > I think phrased this way, the meaning should be clear to anyone familiar > with the basic concept of comparison functions, while not mentioning -1, 0 > and 1 in particular. Sounds good! > PS: Yes, I'm aware that you can also return a floating point number. No, > you should definitely not do that, because it's going to get casted to an > integer and produce wrong results if the numbers get large enough. That sounds like something we could easily and cheaply fix… Regards, Andrea