Determining Whether An Object Is An Instance Of A Particular Class : is_a « Reflection « PHP






Determining Whether An Object Is An Instance Of A Particular Class

 
<?
class Shape { 

    function __construct() 
    { 
    } 
} 


$polly = new Shape('Polynesia'); 
print is_a($polly, 'Shape') ? '' : 'not '; 

?>
  
  








Related examples in the same category

1.PHP is_ Functions