• PHP Video Tutorials

PHP - Stack class Functions


Advertisements

A Stack is a “last in, first-out” or “LIFO” collection that can allow only access to the value at the top of structure and iterate in that order destructively. This class can use Ds\Vector internally.

Class synopsis

Ds\Stack implements Ds\Collection {
   /* Methods */
   public void allocate( int $capacity )
   public int capacity( void )
   public void clear( void )
   public Ds\Stack copy( void )
   public bool isEmpty( void )
   public mixed peek( void )
   public mixed pop( void )
   public void push([ mixed $...values ] )
   public array toArray( void )
}
Sr.No Functions & Description
1

Ds\Stack::copy() Function

This function can return a shallow copy of the stack.

2

Ds\Stack::count() Function

This function can be used to count the number of elements present in a stack.

3

Ds\Stack::isEmpty() Function

This function can return whether the stack is empty.

4

Ds\Stack::jsonSerialize() Function

This function can return the representation that can be converted to JSON.

5

Ds\Stack::peek() Function

This function can return the value at the top of a stack.

6

Ds\Stack::pop() Function

This function can remove and return the value at the top of a stack.

7

Ds\Stack::push() Function

This function can push the values onto a stack.

8

Ds\Stack::toArray() Function

This function can convert the stack to an array.

php_function_reference.htm

Useful Video Courses


Video

PHP Online Training

45 Lectures 9 hours

Malhar Lathkar

Video

Become PHP Facebook Developer: Password-Less Authentication

34 Lectures 4 hours

Syed Raza

Video

Ultimate PHP & MySQL Web Development Course & OOP Coding

84 Lectures 5.5 hours

Frahaan Hussain

Video

Learn PHP from Scratch

17 Lectures 1 hours

Nivedita Jain

Video

E Commerce Website Development In PHP With PDO

100 Lectures 34 hours

Azaz Patel

Video

PHP in Telugu

43 Lectures 5.5 hours

Vijay Kumar Parvatha Reddy

Advertisements