ahp/stack

A simple implementation of a stack in php.

dev-master 2018-12-31 08:42 UTC

This package is auto-updated.

Last update: 2024-04-29 04:03:09 UTC


README

A simple implementation of stack in php.

Install

composer require ahp/stack

usage

$stack = new Stack();

// Push an item into the stack
$stack->push($value);

// Pop last item from the stack
$stack->pop();

// Shows the last value at the end of the stack
$stack->peek();

// Validates whether stack is empty.
$stack->isEmpty();

//Merges the given array into stack.
$stack->merge($array)

// Get all of the values inside the stack.
$stack->get();

// Clear stack entirely.
$stack->fresh();