- is_a: documentation ( source)
<?php
class Hello{
private $say;
private function hey()
{
echo 'hey';
}
public function say(Hello $obj = null, $val = null)
{
if (null === $obj)
{
return $this->say;
}
$obj->say = $val;
$obj->hey();
}
public function __toString()
{
return $this->say;
}
}
$test1 = new Hello;
$test2 = new Hello;
$test1->say($test2, 'Hello');
echo is_a('FF', 'World', true);