ahp/stack

A simple implementation of a stack in php.

Maintainers

Package info

github.com/A-H-Pooladvand/stack

pkg:composer/ahp/stack

Statistics

Installs: 24

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-03-01 00:26:37 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();