Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我检查defined('SomeClass::CONSTANT')并且 SomeClass 不存在,我会收到一个致命错误。不应该定义()返回false吗?
defined('SomeClass::CONSTANT')
这可以是替代解决方案..
if (class_exists('class_name')) { if(defined('class_name::CONSTANT')){ // your logic } }