Ds\Queue::toArray
PHP function
Edit on GitHub ✎
(PECL ds >= 1.0.0)
Converts the queue to an Array
Description
Ds\Queue::toArray(): array
Converts the queue to an Array.
Note
Casting to an Array is not supported yet.
Note
This method is not destructive.
Parameters Parameters
Return Values
An Array containing all the values in the same order as the queue.
Examples
Ds\Queue::toArray() example
php
<?php
$queue = new \Ds\Queue([1, 2, 3]);
var_dump($queue->toArray());
?>The above example will output something similar to:
output
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}