Treat the map as a stack and push an element onto its end.

@return $this
@api
760561
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;
    }
232504
public function makeRoot()
    {
        if ($this->getLeftValue() || $this->getRightValue()) {
            throw new PropelException('Cannot turn an existing node into a root node.');
        }

        $this->setLeftValue(1);
        $this->setRightValue(2);
        $this->setLevel(0);

        return $this;
    }
810267
public function clear() {
        $this->nested = [];
        $this->getter = null;
        $this->setter = null;
        return $this;
    }
247514
public function push()
    {
        $args = func_get_args();

        if (!empty($args)) {
            foreach ($args as  $arg) {
                array_push($this->attributes, $arg);
            }
        }

        return $this;
    }
986296
public function addTo(Map $map)
    {
        $this->map = $map;
        $map->addLayer($this);

        return $this->addMethod('addTo', array($map));
    }
291510
public function pushBack(){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		$this->_Arr = \array_merge($this->_Arr, \func_get_args());
		
		return $this;
		
	}
892416
public function pop()
    {
        $value = $this->stack[$this->current];

        unset($this->stack[$this->current]);

        --$this->current;

        if ($this->current < 0) {
            $this->reset();
        }

        return $value;
    }
308752
private function wrap($element) {
        $this->stack[] = $this->data;
        foreach ($element as $k => $v) {
            $this->data[$k] = $v;
        }
    }
856986
public function on_elements_end() {

        foreach ($this->mappings as $mapping) {
            $this->write_xml('workshopform_numerrors_map', $mapping, array('/workshopform_numerrors_map/id'));
        }

        foreach ($this->dimensions as $dimension) {
            $this->write_xml('workshopform_numerrors_dimension', $dimension, array('/workshopform_numerrors_dimension/id'));
        }
    }
44014
function endList()
    {
        $listItemArray = array();
        // Buils list item array
        foreach ( $this->DocumentStack[$this->CurrentStackNumber]['ChildArray'] as $listItem )
        {
            $listItemArray[] = array( 'Type' => 'listitem',
                                      'Content' => $listItem );
        }

        $this->CurrentStackNumber -= 1;

        if ( $this->CurrentStackNumber == 0 )
        {
            $this->DocumentArray[] = array( 'Type' => 'list',
                                            'ListType' => $this->DocumentStack[$this->CurrentStackNumber + 1]['ListType'],
                                            'Content' => $listItemArray );
        }
        else
        {
            $elementArray = array( 'Type' => 'list',
                                   'ListType' => $this->DocumentStack[$this->CurrentStackNumber + 1]['ListType'],
                                   'Content' => $listItemArray );

            $this->addElement( $elementArray );
        }
    }
1000271
function push(element) {
    /* jshint validthis:true */
    var i;

    if (arguments.length === 1) {
        pushSingle(this, element);
    } else {
        for (i = 0; i < arguments.length; i++) {
            pushSingle(this, arguments[i]);
        }
    }

    return this.length;
}
992455
public function toBePresent()
    {
        $this->wait()->until(WebDriverExpectedCondition::presenceOfElementLocated($this->elementFinder->getSearchCriteria()));

        return $this;
    }
823132
public function pop(& $item) : Stack
    {
        $values = $this->_pop($item);
        $this->setValues($values);
        return $this;
    }
829414
public function end()
    {
        if ($this->_discardActiveBufferOnEnd) {
            $this->_discardActiveBufferOnEnd = false;
            ob_end_clean();

            return;
        }
        if ($this->_active) {
            $mode = end($this->_active);
            $active = key($this->_active);
            $content = ob_get_clean();
            if ($mode === ViewBlock::OVERRIDE) {
                $this->_blocks[$active] = $content;
            } else {
                $this->concat($active, $content, $mode);
            }
            array_pop($this->_active);
        }
    }
450544
public function traversable()
    {
        $message   = ['%s is {{not|}} traversable', $this->value];
        $assertion = (is_array($this->value) || $this->value instanceof Traversable);
        $this->assert($assertion, $message);

        return $this;
    }
123674
public function moveToTop()
    {
        if ($this->isNotInList()) return $this;

        $this->getConnection()->transaction(function() {

            $this->incrementPositionsOfItemsAbove();

            $this->setListPosition($this->listifyTop());
        });

        return $this;
    }
423522
function pop(stack, metaStack) {
  var obj = stack.pop();

  if (metaStack.length) {
    var lastMetaElement = metaStack[metaStack.length - 1];
    if (obj === lastMetaElement.element) {
      // popping a meta-element, e.g. an object whose value is another object
      metaStack.pop();
      lastMetaElement = metaStack[metaStack.length - 1];
    }
    var element = lastMetaElement.element;
    var lastElementIndex = lastMetaElement.index;
    if (Array.isArray(element)) {
      element.push(obj);
    } else if (lastElementIndex === stack.length - 2) { // obj with key+value
      var key = stack.pop();
      element[key] = obj;
    } else {
      stack.push(obj); // obj with key only
    }
  }
}