$x instanceof __CLASS__
| From: | Jochem Maas | Date: | Tue, 27 Dec 2005 14:30:48 +0000 |
| Subject: | $x instanceof __CLASS__ | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-21345@lists.php.net to get a copy of this message | ||
hi there,
a quick question regarding whether the following is by design,
because it causes a parse error (the code I tried out did occur within
a class definition ! :-):
if (!$field instanceof __CLASS__) {
// do something
}
where as this obviously does work:
$class = __CLASS__;
if (!$field instanceof $class) {
// do something
}
as does this:
if (!$field instanceof self) {
// do something
}
rgds,
jochem