summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-07-26 15:31:23 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-07-26 15:31:23 +0200
commit4104abb21a40fa0057c488199769b24519aa1da7 (patch)
treee8b5ce1891596fd83fa0bcb3d6ee2a89930d9b70
parent8e089ea9174ca133f938bdb16ef14e7a1027ccaf (diff)
autoload check had to be exactly the other way around
-rw-r--r--zend/exists.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/zend/exists.cpp b/zend/exists.cpp
index b5bc64f..3add227 100644
--- a/zend/exists.cpp
+++ b/zend/exists.cpp
@@ -35,6 +35,14 @@ bool class_exists(const char *classname, size_t len, bool autoload)
// should we autoload the class?
if (autoload)
{
+ // no auto-load
+ if (SUCCESS != zend_lookup_class(classname, len, &ce TSRMLS_CC)) return false;
+
+ // the found "class" could also be an interface or trait, which we do no want
+ return ((*ce)->ce_flags & (ZEND_ACC_INTERFACE | (ZEND_ACC_TRAIT - ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) == 0;
+ }
+ else
+ {
// starting slashes can be ignored
if (len > 0 && classname[0] == '\\') { classname++; len--; }
@@ -52,14 +60,6 @@ bool class_exists(const char *classname, size_t len, bool autoload)
// the found "class" could also be an interface or trait, which we do no want
return !(((*ce)->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT)) > ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
}
- else
- {
- // no auto-load
- if (SUCCESS != zend_lookup_class(classname, len, &ce TSRMLS_CC)) return false;
-
- // the found "class" could also be an interface or trait, which we do no want
- return ((*ce)->ce_flags & (ZEND_ACC_INTERFACE | (ZEND_ACC_TRAIT - ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) == 0;
- }
}
/**