[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-bugs
Subject:    [DOC-BUGS] Doc #73267 [Com]: Order by callback changed
From:       "me at evertpot dot com" <php-bugs () lists ! php ! net>
Date:       2016-10-20 23:28:57
Message-ID: 201610202328.u9KNSv8S006199 () sgrv20 ! php ! net
[Download RAW message or body]

Edit report at https://bugs.php.net/bug.php?id=73267&edit=1

 ID:                 73267
 Comment by:         me at evertpot dot com
 Reported by:        me at evertpot dot com
 Summary:            Order by callback changed
 Status:             Closed
 Type:               Documentation Problem
 Package:            Arrays related
 PHP Version:        7.1.0RC3
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Thank, that's really awesome!


Previous Comments:
------------------------------------------------------------------------
[2016-10-18 14:58:42] cmb@php.net

Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=340557
Log: Fix #73267: Order by callback changed

While users are not supposed to rely on a stable sort anyway, it
may be helpful to explicitly mention possible sort order changes
in the migration guides.

------------------------------------------------------------------------
[2016-10-18 14:58:25] cmb@php.net

I've noticed that the 7.0 UPGRADING has a respective note[1], so
it appears to be okay to also add notes to the 7.0 and 7.1
migration guides.

> I definitely meant to mark it as a "documentation bug" but
> somehow that setting got lost.

That's a nasty bug of the bug tracker. Previewing discards any
changes to the "Bug Type".

[1] <https://github.com/php/php-src/blob/PHP-7.0.12/UPGRADING#L434-L435>

------------------------------------------------------------------------
[2016-10-08 15:23:39] me at evertpot dot com

Hi cmb,

Thanks for the quick change. I definitely meant to mark it as a "documentation bug" \
but somehow that setting got lost.

I actually have a simpler test-case that demonstrates that it's not just equality of \
identical values:

https://3v4l.org/kH84K

It was a bit late yesterday, so I didn't catch this.

Now the result of this function might also (as you said) "undefined", and I readily \
admit that my unittest was wrong assuming a certain output, but it might still be a \
nice courtesy to include it in the migration documentation. Of course you can include \
in that document that relying on a sort order in the first place was wrong.

------------------------------------------------------------------------
[2016-10-08 09:12:19] cmb@php.net

Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=340377
Log: Fix #73267: Order by callback changed

------------------------------------------------------------------------
[2016-10-08 09:10:45] cmb@php.net

Indeed, the sorting order has changed, but that is an
implementation detail that should not be relied upon anyway,
because:

> If two members compare as equal, their relative order in the
> sorted array is undefined.

That's already documented for all? other sorting functions, but
has been forgotten for array_multisort().

Adding a note to the changelog or migration guide regarding a
behavioral change of undefined behavior wouldn't make sense (the
behavior is still undefined).

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=73267


--
Edit this bug report at https://bugs.php.net/bug.php?id=73267&edit=1

-- 
PHP Documentation Bugs Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic