Closed azjezz closed 6 years ago
Provide a narrative description of what you are trying to accomplish:
master
CHANGELOG.md
The current SplPriorityQueue doesn't reset the serial property after serialization which makes it not equal to the original PriorityQueue.
<?php use Zend\Stdlib\SplPriorityQueue as Queue; $queue = new Queue(); $queue->insert('foo', 3); $queue->insert('bar', 4); $queue->insert('baz', 2); $queue->insert('bat', 1); $serialized = serialize($queue); $unserialized = unserialize($serialized); $serial = new ReflectionProperty(Queue::class, 'serial'); $serial->setAccessible(true); if ($serial->getValue($queue) === $serial->getValue($unserialized)) { print 'cool !'; } else { print 'oh ?'; }
original, incorrect behavior : prints oh ? new, correct behavior : prints cool !
oh ?
cool !
Thanks, @azjezz!
Provide a narrative description of what you are trying to accomplish:
master
branch, and submit against that branch.CHANGELOG.md
entry for the fix.The current SplPriorityQueue doesn't reset the serial property after serialization which makes it not equal to the original PriorityQueue.
original, incorrect behavior : prints
oh ?
new, correct behavior : printscool !