Type Operators:
This is another kind of operator, instanceof, this operator is used to check an object that whether this is an object of specified class or not.
instanceof can also be used to determine whether an object of a class is inheriting property from another class or not.
It can also check that an object is not an instanceof a class, the logical not is used.
Example:
<?php
class
A{
var $var; function disp(){
echo "Inside the class";}
}
$obj
=new A;var_dump(
$obj instanceof A);?>
Output:
bool(true)
Example:
<?php
class
A{
var $var; function disp(){
echo "Inside the class";}
}
$obj
=new A;var_dump (!(
$obj instanceof A));?>
Output:
bool(false)