src/Map.php
public function push($element)
    {
        // ask PHP to give me the next index
        // http://stackoverflow.com/q/3698743/2908724
        $this->array[] = 'probe';
        end($this->array);
        $next = key($this->array);
        unset($this->array[$next]);

        // hash that and store
        $this->set($next, $element);

        return $this;
    }
public function push($element)
    {
        // ask PHP to give me the next index
        // http://stackoverflow.com/q/3698743/2908724
        $this->array[] = 'probe';
        end($this->array);
        $next = key($this->array);
        unset($this->array[$next]);

        // hash that and store
        $this->set($next, $element);

        return $this;
    }
public function push ( $ element ) { // ask PHP to give me the next index // http://stackoverflow.com/q/3698743/2908724 $ this -> array [ ] = 'probe' ; end ( $ this -> array ) ; $ next = key ( $ this -> array ) ; unset ( $ this -> array [ $ next ] ) ; // hash that and store $ this -> set ( $ next , $ element ) ; return $ this ; }
Treat the map as a stack and push an element onto its end.

@return $this
@api
Treat the map as a stack and push an element onto its end .