note 72127 deleted from language.operators.type by colder
| From: | colder@php.net | Date: | Thu, 04 Jan 2007 00:50:45 +0000 |
| Subject: | note 72127 deleted from language.operators.type by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121264@lists.php.net to get a copy of this message | ||
Note Submitter: info at adaniels dot nl
Reason: bad code
----
Here a small snipplet to test if a class extends another class.
<?php
function class_is_a($class, $base_class)
{
$o = unserialize('O:'. strlen($class) . ':"' . $class .
'":0:{}');
return $o instanceof $base_class;
}
?>
Enjoy :)