array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'ds-stack.toarray.php', 1 => 'Ds\\Stack::toArray', ), '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', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
Cette fonction ne contient aucun paramètre.
An tableau containing all the values in the same order as the stack.
Exemple #1 Ds\Stack::toArray() example
<?php
$stack = new \Ds\Stack([1, 2, 3]);
var_dump($stack->toArray());
?>
Résultat de l'exemple ci-dessus est similaire à :
array(3) { [0]=> int(3) [1]=> int(2) [2]=> int(1) }