Using require_once() would help against including a class file more than once.
![]() |
|
||||||||||
|
class_existsОписаниеbool class_exists ( string class_name )
Функция возвращает TRUE если класс См. также get_declared_classes(). class_exists
peterw
13-May-2007 04:27
Using require_once() would help against including a class file more than once.
Frayja
01-Jun-2006 01:42
Like someone else pointed out class_exists() is case-INsensitive.
josh at digitalfruition dot com
25-Jun-2005 11:23
Just to note, class names appear to be case INsensitive. (At least at the time of writing in PHP 4.3.9). Take the following example:
andrey at php dot net
24-Oct-2004 04:43
In 5.0.0 and 5.0.1 there was no interface_exists() and in these versions class_exists() used to return TRUE for known interfaces. Starting 5.0.2 this is no more.
06-Apr-2004 05:04
Just a note that at least PHP 4.3.1 seems to crash under some situations if you call class_exists($foo) where $foo is an array (that is, the calling code is incorrect but the error recovery is far from perfect).
anonymous at somewhere dot tld
17-Jul-2003 12:20
If you have a directory of classes you want to create. (Modules in my instance)... you can do it like that
cristiano at aspatech dot com dot br
24-Jun-2002 11:36
This can be veeeery usefull if you use classes that uses other classes, which can be used in your front end. In other words, when you lost the control of which classes are declared in which point of the application, that can generate the "Cannot redeclare class". Use like
spamless_blair at nb dot net
09-Oct-2001 01:48
I have a script that includes various class libraries depending on what is contained in the constant _INCLUDE_LIST which is a comma-delimited string. |