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

Ds\Stack::toArray

(PECL ds >= 1.0.0)

Ds\Stack::toArray Converts the stack to an array

Descrizione

public Ds\Stack::toArray(): array

Converts the stack to an array.

Nota:

Casting to an array is not supported yet.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

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

Esempi

Example #1 Ds\Stack::toArray() example

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

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

Il precedente esempio visualizzerĂ  qualcosa simile a:

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