note 57399 deleted from language.operators.type by colder
| From: | colder@php.net | Date: | Sat, 24 Feb 2007 10:02:48 +0000 |
| Subject: | note 57399 deleted from language.operators.type by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123810@lists.php.net to get a copy of this message | ||
Note Submitter: klaazvaag . gmail . com
----
If you wish to do a short but dynamic comparison using instanceof, you can use this code:
<?php
class any
{
function __construct($obj)
{
if (is_object($obj))
if ($obj instanceof self)
echo '$obj is an instance of '.__CLASS__;
}
}
?>