Bug #76265 [Opn]: The order of the same priority is disordered
| From: | cmb@php.net | Date: | Wed, 25 Apr 2018 23:24:54 +0000 |
| Subject: | Bug #76265 [Opn]: The order of the same priority is disordered | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214898@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 disordered
Status: Open
Type: Bug
Package: SPL related
Operating System: Linux
PHP Version: 7.0.29
Block user comment: N
Private report: N
New Comment:
Related to request #60926.
Previous Comments:
------------------------------------------------------------------------
[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