note 66929 deleted from function.class-exists by tularis
| From: | tularis@php.net | Date: | Tue, 17 Jan 2012 21:15:57 +0000 |
| Subject: | note 66929 deleted from function.class-exists by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185690@lists.php.net to get a copy of this message | ||
Note Submitter: Frayja
----
Like someone else pointed out class_exists() is case-INsensitive.
Using in_array() which is case-sensitive, the following function is a case-sensitive version of
class_exists().
<?php
function class_exists_sensitive( $classname )
{
return ( class_exists( $classname ) && in_array( $classname, get_declared_classes() ) );
}
?>