• PHP Video Tutorials

PHP - Ds\Stack::isEmpty() Function



Ds\Stack::isEmpty() function can return whether the stack is empty.

Syntax

public bool Ds\Stack::isEmpty( void )

Ds\Stack::isEmpty() function doesn't have any parameters.

Ds\Stack::isEmpty() function can return true if the stack is empty, or false otherwise.

Example

<?php    
   $stack = new \Ds\Stack(); 
   var_dump($stack->isEmpty()); 
  
   $stack->push("Tutorials"); 
   $stack->push("Point"); 
   $stack->push("India"); 
  
   var_dump($stack->isEmpty()); 
?>
php_function_reference.htm
Advertisements