PHP 8.5.0 Alpha 1 available for testing

Ds\Stack::toArray

(PECL ds >= 1.0.0)

Ds\Stack::toArray Convierte la pila en un tableau

Descripción

public Ds\Stack::toArray(): array

Convierte la pila en un tableau.

Nota:

La conversión en tableau no está aún soportada.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Un tableau que contiene todos los valores en el mismo orden que la pila.

Ejemplos

Ejemplo #1 Ejemplo de Ds\Stack::toArray()

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

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

El resultado del ejemplo sería algo similar a:

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

User Contributed Notes

There are no user contributed notes for this page.
To Top