Re: is_a() against instanceof
| From: | Christian Stadler | Date: | Wed, 16 Mar 2005 02:18:28 +0000 |
| Subject: | Re: is_a() against instanceof | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210869@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Eli schrieb:
> - ($cls instanceof ClassName) *requires* from ClassName to be declared,
> and generates a fatal error when ClassName is not declared.
How about
if (class_exists('ClassName') AND $cls instanceof ClassName)
{
...
}
Regards,
Christian Stadler
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCN5d09250Hcbf/3IRAjACAJ4nuKWyohEgv74Ycj/oXYn/7vWW7gCaAqm3
FV6CJd6Sz3+K4Ur4WlKRlcM=
=K8j5
-----END PGP SIGNATURE-----