Doc #76265 [Ver->Csd]: The order of the same priority is not maintained
| From: | cmb@php.net | Date: | Sat, 16 Jun 2018 15:42:10 +0000 |
| Subject: | Doc #76265 [Ver->Csd]: The order of the same priority is not maintained | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15774@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76265&edit=1
ID: 76265
Updated by: cmb@php.net
Reported by: admin at yurunsoft dot com
Summary: The order of the same priority is not maintained
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: SPL related
Operating System: Linux
PHP Version: 7.0.29
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-06-16 15:40:42] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=345154
Log: Fix #76265: The order of the same priority is not maintained
------------------------------------------------------------------------
[2018-06-16 15:32:40] cmb@php.net
To clarify: this is not bug, but rather a deliberate design
decision for performance reasons. Since there is already a
respective feature request (<https://bugs.php.net/60926>), I'm
changing this ticket to doc problem.
------------------------------------------------------------------------
[2018-04-25 23:24:53] cmb@php.net
Related to request #60926.
------------------------------------------------------------------------
[2018-04-25 10:11:10] admin at yurunsoft dot com
Description:
------------
The order of the same priority is disordered
Test script:
---------------
$l = new \SplPriorityQueue;
$l->insert('e', 1);
$l->insert('a', 0);
$l->insert('b', 0);
$l->insert('c', 0);
$l->insert('d', 100);
var_dump($l);
Expected result:
----------------
d
e
a
b
c
Actual result:
--------------
object(SplPriorityQueue)#4 (3) {
["flags":"SplPriorityQueue":private]=>
int(1)
["isCorrupted":"SplPriorityQueue":private]=>
bool(false)
["heap":"SplPriorityQueue":private]=>
array(5) {
[0]=>
array(2) {
["data"]=>
string(1) "d"
["priority"]=>
int(100)
}
[1]=>
array(2) {
["data"]=>
string(1) "e"
["priority"]=>
int(1)
}
[2]=>
array(2) {
["data"]=>
string(1) "b"
["priority"]=>
int(0)
}
[3]=>
array(2) {
["data"]=>
string(1) "c"
["priority"]=>
int(0)
}
[4]=>
array(2) {
["data"]=>
string(1) "a"
["priority"]=>
int(0)
}
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76265&edit=1