Re: note 17202 added to function.class-exists
| From: | Zak Greant | Date: | Thu, 29 Nov 2001 15:54:41 +0000 |
| Subject: | Re: note 17202 added to function.class-exists | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21437@lists.php.net to get a copy of this message | ||
On November 29, 2001 08:52 am, bart@www.zabiny.cz wrote:
> The method 'class_exists' doesn't work really properly. In the function
> declarion I've used "if (!class_exist("foo")) include
> ("foo.php");". After
> that I have used the same check in another function and when I've called
> function1(); function2(); the !class_exists("foo.php") in the function2
> evaluated as true and the class 'foo.php' was included twice, what resulted
> into a fatal error.
Use
! class_exists ('foo')
instead of
! class_exists ('foo.php')
--
Zak Greant
PHP Quality Assurance Team
http://qa.php.net/
"We must be the change we wish to see." - M. K. Ghandi