defined() requires class to exist when testing for class const (only in PHP_5_2)
| Bug #47601 | defined() requires class to exist when testing for class const (only in PHP_5_2) | ||||
|---|---|---|---|---|---|
| Submitted: | 2009-03-08 22:55 UTC | Modified: | 2010-02-08 12:31 UTC | ||
| From: | david at grudl dot com | Assigned: | |||
| Status: | Closed | Package: | Scripting Engine problem | ||
| PHP Version: | 5.2CVS-2009-03-10 | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2009-03-08 22:55 UTC] david at grudl dot com
Description:
------------
Function defined() is very strict whether class constant is checking. Non-declared (and not-autoloaded) class can be rather expressed as FALSE than fatal error.
Reproduce code:
---------------
var_dump( defined('Test::VALUE') );
Expected result:
----------------
FALSE
Actual result:
--------------
Fatal error: Class 'Test' not found
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2009-03-09 00:15 UTC] david at grudl dot com
[2010-02-08 12:31 UTC] iliaa@php.net