SplPriorityQueue
extends SplPriorityQueue
in package
implements
Serializable
Serializable version of SplPriorityQueue
Also, provides predictable heap order for datums added with the same priority (i.e., they will be emitted in the same order they are enqueued).
Tags
Table of Contents
Interfaces
- Serializable
Properties
- $serial : int
Methods
- __serialize() : array<string|int, mixed>
- Magic method used for serializing of an instance.
- __unserialize() : void
- Magic method used to rebuild an instance.
- insert() : void
- Insert a value with a given priority
- serialize() : string
- Serialize
- toArray() : array<int, TValue>
- Serialize to an array
- unserialize() : void
- Deserialize
Properties
$serial
protected
int
$serial
= \PHP_INT_MAX
Seed used to ensure queue order for items of the same priority
Methods
__serialize()
Magic method used for serializing of an instance.
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
Magic method used to rebuild an instance.
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
-
Data array.
insert()
Insert a value with a given priority
public
insert(TValue $datum, TPriority $priority) : void
Utilizes $serial to ensure that values of equal priority are emitted in the same order in which they are inserted.
Parameters
- $datum : TValue
- $priority : TPriority
serialize()
Serialize
public
serialize() : string
Return values
stringtoArray()
Serialize to an array
public
toArray() : array<int, TValue>
Array will be priority => data pairs
Return values
array<int, TValue>unserialize()
Deserialize
public
unserialize(string $data) : void
Parameters
- $data : string