Determining Whether An Object Is An Instance Of A Particular Class : is_a « Reflection « PHP
- PHP
- Reflection
- is_a
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