diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 6a8ae805fc2..a1fbe049f3f 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -505,8 +505,8 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal } \ } while (0) -#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS) -#define ZEND_CLASS_HAS_READONLY_PROPS(ce) ((ce->ce_flags & ZEND_ACC_HAS_READONLY_PROPS) == ZEND_ACC_HAS_READONLY_PROPS) +#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((bool)(ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) +#define ZEND_CLASS_HAS_READONLY_PROPS(ce) ((bool)(ce->ce_flags & ZEND_ACC_HAS_READONLY_PROPS)) ZEND_API bool zend_verify_class_constant_type(zend_class_constant *c, const zend_string *name, zval *constant); diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index f331cb30d8b..3e09206b315 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2281,7 +2281,7 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_ * of where it is coming from there is no conflict and we do not need to add it again */ if (existing_fn->op_array.opcodes == fn->op_array.opcodes && (existing_fn->common.fn_flags & ZEND_ACC_PPP_MASK) == (fn->common.fn_flags & ZEND_ACC_PPP_MASK) && - (existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + (existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT)) { return; } @@ -2347,7 +2347,7 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_ static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /* {{{ */ { - if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + if (fn->common.scope->ce_flags & ZEND_ACC_TRAIT) { fn->common.scope = ce; diff --git a/ext/standard/string.c b/ext/standard/string.c index 9f7e0ff60d3..944b39224ae 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1600,11 +1600,11 @@ PHP_FUNCTION(pathinfo) Z_PARAM_LONG(opt) ZEND_PARSE_PARAMETERS_END(); - have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME); + have_basename = (opt & PHP_PATHINFO_BASENAME); array_init(&tmp); - if ((opt & PHP_PATHINFO_DIRNAME) == PHP_PATHINFO_DIRNAME) { + if (opt & PHP_PATHINFO_DIRNAME) { dirname = estrndup(path, path_len); php_dirname(dirname, path_len); if (*dirname) { @@ -1618,7 +1618,7 @@ PHP_FUNCTION(pathinfo) add_assoc_str(&tmp, "basename", zend_string_copy(ret)); } - if ((opt & PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) { + if (opt & PHP_PATHINFO_EXTENSION) { const char *p; ptrdiff_t idx; @@ -1634,7 +1634,7 @@ PHP_FUNCTION(pathinfo) } } - if ((opt & PHP_PATHINFO_FILENAME) == PHP_PATHINFO_FILENAME) { + if (opt & PHP_PATHINFO_FILENAME) { const char *p; ptrdiff_t idx;