summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2019-12-24 14:21:52 +0800
committerXinchen Hui <laruence@gmail.com>2019-12-24 14:21:52 +0800
commit3f3c1ad848cc3c0e94c8586bcd84bf3386a2d0d3 (patch)
treef477d9132d2cfbcba00fd695be83ad0c990dda34 /Zend/zend_builtin_functions.c
parent1e53769d82dadd2ea1aa05aa5397f192f7c33c4d (diff)
parentf09b958e90afc0458a30a2c775abc2525827e7ac (diff)
downloadphp-git-3f3c1ad848cc3c0e94c8586bcd84bf3386a2d0d3.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Similar problem (#79022) also exists in Interfaces Fixed bug #79022 (class_exists returns True for classes that are not ready to be used)
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 2832fb3e0a..b24d620c71 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1248,7 +1248,7 @@ static inline void class_exists_impl(INTERNAL_FUNCTION_PARAMETERS, int flags, in
}
if (ce) {
- RETURN_BOOL((flags == 0 || (ce->ce_flags & flags)) && !(ce->ce_flags & skip_flags));
+ RETURN_BOOL(((ce->ce_flags & flags) == flags) && !(ce->ce_flags & skip_flags));
} else {
RETURN_FALSE;
}
@@ -1259,7 +1259,7 @@ static inline void class_exists_impl(INTERNAL_FUNCTION_PARAMETERS, int flags, in
Checks if the class exists */
ZEND_FUNCTION(class_exists)
{
- class_exists_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT);
+ class_exists_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_LINKED, ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT);
}
/* }}} */
@@ -1267,7 +1267,7 @@ ZEND_FUNCTION(class_exists)
Checks if the class exists */
ZEND_FUNCTION(interface_exists)
{
- class_exists_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_INTERFACE, 0);
+ class_exists_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_LINKED|ZEND_ACC_INTERFACE, 0);
}
/* }}} */