ahp / stack
A simple implementation of a stack in php.
dev-master
2018-12-31 08:42 UTC
Requires
- php: ^7.1
This package is auto-updated.
Last update: 2025-03-01 00:19:49 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();