Q:

Implementing stack with php for normal array

I need to make a stack using php, all of the examples I saw were for associative arrays I need a normal array because I'm gonna retrieve a bunch of strings calling them by their id which are in this array. I thought that a stack would make it easier .. but of course there's always something. 
I was trying to work on this but it's an associative array 
class Stack {
    private $stk = array();

    public function __construct() {
    }

    public function push($data) {
        array_push($this->stk, $data);
    }

    public function pop() {
        return array_pop($this->stk);
    }

}

Is there anyway around it ? 
Please guide me and if you have any idea how to do that without a stack I'll be thankful!

A:

PHP has already a stack structure implemented... It has all the features you could possibly want and it's much faster.
http://php.net/manual/en/class.splstack.php

