Overview

Namespaces

  • BN
    • Collections
    • Compiler
      • Grammar
      • Parser
        • Operator
        • Token
      • Postfix
        • Operands
        • Operator
        • Token
      • Scanner
        • Converter
      • Token
  • Demo
  • None

Classes

  • LinearDataStructure
  • Queue
  • Stack

Exceptions

  • NullArgumentException
  • Overview
  • Namespace
  • Class
  • Tree

Class Stack

Class represeting LIFO data structure. The last element added to the stack will be the first one to be removed.

BN\Collections\LinearDataStructure
Extended by BN\Collections\Stack
Namespace: BN\Collections
Located at lib/BN/Collections/Stack.php
Methods summary
public
# push( mixed $element )

Inserts element to the beggining of the stack

Inserts element to the beggining of the stack

Parameters

$element
mixed
$element

Throws

BN\Collections\NullArgumentException
public mixed
# pop( )

Removes and returns first element of the stack. Returns null if the stack is empty

Removes and returns first element of the stack. Returns null if the stack is empty

Returns

mixed
public mixed
# peek( )

Returns first element of the stack (element is not removed from the stack). Returns null if the stack is empty

Returns first element of the stack (element is not removed from the stack). Returns null if the stack is empty

Returns

mixed
Methods inherited from BN\Collections\LinearDataStructure
checkIfElementIsNotNull(), clear(), isEmpty(), size()
Properties inherited from BN\Collections\LinearDataStructure
$data
BN-PHP - Big Number data type for PHP API documentation generated by ApiGen 2.8.0