PriorityQueue
PHP Manual

Ds\PriorityQueue::copy

(PECL ds >= 1.0.0)

Ds\PriorityQueue::copyReturns a shallow copy of the queue

Beschreibung

public Ds\PriorityQueue Ds\PriorityQueue::copy ( void )

Returns a shallow copy of the queue.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns a shallow copy of the queue.

Beispiele

Beispiel #1 Ds\PriorityQueue::copy() example

<?php
$queue 
= new \Ds\PriorityQueue();

$queue->push("a",  5);
$queue->push("b"15);
$queue->push("c"10);

print_r($queue->copy());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Ds\PriorityQueue Object
(
    [0] => b
    [1] => c
    [2] => a
)

PriorityQueue
PHP Manual