array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'ds-deque.toarray.php', 1 => 'Ds\\Deque::toArray', 2 => 'Converts the deque to an array', ), 'up' => array ( 0 => 'class.ds-deque.php', 1 => 'Ds\\Deque', ), 'prev' => array ( 0 => 'ds-deque.sum.php', 1 => 'Ds\\Deque::sum', ), 'next' => array ( 0 => 'ds-deque.unshift.php', 1 => 'Ds\\Deque::unshift', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/deque/toarray.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Ds\Deque::toArray

(PECL ds >= 1.0.0)

Ds\Deque::toArray Converts the deque to an array

Опис

public Ds\Deque::toArray(): array

Converts the deque to an array.

Зауваження:

Casting to an array is not supported yet.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

An array containing all the values in the same order as the deque.

Приклади

Приклад #1 Ds\Deque::toArray() example

<?php
$deque
= new \Ds\Deque([1, 2, 3]);

var_dump($deque->toArray());
?>

Поданий вище приклад виведе щось схоже на:

array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}