note 66929 added to function.class-exists

From: Date: Thu, 01 Jun 2006 08:42:00 +0000
Subject: note 66929 added to function.class-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-112717@lists.php.net to get a copy of this message
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() ) ); } ?> ---- Server IP: 194.109.193.119 Probable Submitter: 83.161.19.24 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.class-exists.php Edit -- http://master.php.net/note/edit/66929 Del: integrated -- http://master.php.net/note/delete/66929/integrated Del: useless -- http://master.php.net/note/delete/66929/useless Del: bad code -- http://master.php.net/note/delete/66929/bad+code Del: spam -- http://master.php.net/note/delete/66929/spam Del: non-english -- http://master.php.net/note/delete/66929/non-english Del: in docs -- http://master.php.net/note/delete/66929/in+docs Del: other reasons-- http://master.php.net/note/delete/66929 Reject -- http://master.php.net/note/reject/66929 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#112717) next »