You are here

public function SplPriorityQueue::toArray in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/SplPriorityQueue.php \Zend\Stdlib\SplPriorityQueue::toArray()

Serialize to an array

Array will be priority => data pairs

Return value

array

Overrides SplPriorityQueue::toArray

1 method overrides SplPriorityQueue::toArray()
SplPriorityQueue::toArray in vendor/zendframework/zend-stdlib/src/SplPriorityQueue.php
Serialize to an array

File

vendor/zendframework/zend-stdlib/src/SplPriorityQueue.php, line 52

Class

SplPriorityQueue
Serializable version of SplPriorityQueue

Namespace

Zend\Stdlib

Code

public function toArray() {
  $array = [];
  foreach (clone $this as $item) {
    $array[] = $item;
  }
  return $array;
}