<?php if ( ! defined( 'ABSPATH' ) ) exit;
* Created for use with eqEOS. May eventually be replaced with native
* PHP functions `array_pop()`, `array_push()`, and `end()`
* @author Jon Lawrence <jlawrence11@gmail.com>
* @copyright Copyright �2005-2013 Jon Lawrence
* @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License
public function __construct() {
//define the private vars
$this->locArray = array();
* Will view the last element of the stack without removing it
* @return Mixed An element of the array or false if none exist
return $this->locArray[$this->index];
* Will add an element to the end of the stack
* @param Mixed Element to add
public function poke($data) {
$this->locArray[++$this->index] = $data;
* Alias of {@see phpStack::poke()}
* Adds element to the stack
* @param Mixed Element to add
public function push($data) {
* Retrives an element from the end of the stack, and removes it from
* the stack at the same time. If no elements, returns boolean false
* @return Mixed Element at end of stack or false if none exist
return $this->locArray[$this->index+1];
* Clears the stack to be reused.
public function clear() {
$this->locArray = array();
* Returns the array of stack elements, keeping all, indexed at 0
* @return Mixed Array of stack elements or false if none exist.
public function getStack() {
return array_values($this->locArray);