Close GH-5675.
scope->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
}
}
- if (ptr->flags & ZEND_ACC_STATIC && (!scope || !(scope->ce_flags & ZEND_ACC_INTERFACE))) {
+ if ((ptr->flags & ZEND_ACC_STATIC) && (!scope || !(scope->ce_flags & ZEND_ACC_INTERFACE))) {
zend_error(error_type, "Static function %s%s%s() cannot be abstract", scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
}
} else {
if (zv != NULL) {
zend_function *priv_fbc = Z_PTR_P(zv);
- if (priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE
+ if ((priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE)
&& priv_fbc->common.scope == scope) {
fcc->function_handler = priv_fbc;
}
if (fcc->object) {
fcc->called_scope = fcc->object->ce;
if (fcc->function_handler
- && fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC) {
+ && (fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
fcc->object = NULL;
}
}
/* copied upon generator creation */
GC_DELREF(&closure->std);
} else if (ZEND_USER_CODE(my_function.type)
- && fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
+ && (fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE)) {
efree(ZEND_MAP_PTR(my_function.op_array.run_time_cache));
}
}
zend_op *ret;
zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
- if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE
+ if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)
&& !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) {
zend_emit_return_type_check(NULL, CG(active_op_array)->arg_info - 1, 1);
}
}
/* Generator return types are handled separately */
- if (!is_generator && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
+ if (!is_generator && (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
zend_emit_return_type_check(
expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0);
}
ZEND_SET_ARG_FLAG(func, i + 1, ZEND_ARG_SEND_MODE(&func->common.arg_info[i]));
i++;
}
- if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_VARIADIC && ZEND_ARG_SEND_MODE(&func->common.arg_info[i]))) {
+ if (UNEXPECTED((func->common.fn_flags & ZEND_ACC_VARIADIC) && ZEND_ARG_SEND_MODE(&func->common.arg_info[i]))) {
uint32_t pass_by_reference = ZEND_ARG_SEND_MODE(&func->common.arg_info[i]);
while (i < MAX_ARG_FLAG_NUM) {
ZEND_SET_ARG_FLAG(func, i + 1, pass_by_reference);
}
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
- if (ast->attr & ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
+ if ((ast->attr & ZEND_DIM_IS) && ast->child[0]->kind == ZEND_AST_DIM) {
ast->child[0]->attr |= ZEND_DIM_IS;
}
func = zend_hash_find(&scope->function_table, function_name);
if (func != NULL) {
fbc = Z_FUNC_P(func);
- if (fbc->common.fn_flags & ZEND_ACC_PRIVATE
+ if ((fbc->common.fn_flags & ZEND_ACC_PRIVATE)
&& fbc->common.scope == scope) {
return fbc;
}
static int check_id_allowed(char *id, zend_long what) /* {{{ */
{
- if (what & PHP_DATE_TIMEZONE_GROUP_AFRICA && strncasecmp(id, "Africa/", 7) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_AMERICA && strncasecmp(id, "America/", 8) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA && strncasecmp(id, "Antarctica/", 11) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_ARCTIC && strncasecmp(id, "Arctic/", 7) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_ASIA && strncasecmp(id, "Asia/", 5) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_ATLANTIC && strncasecmp(id, "Atlantic/", 9) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_AUSTRALIA && strncasecmp(id, "Australia/", 10) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_EUROPE && strncasecmp(id, "Europe/", 7) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_INDIAN && strncasecmp(id, "Indian/", 7) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_PACIFIC && strncasecmp(id, "Pacific/", 8) == 0) return 1;
- if (what & PHP_DATE_TIMEZONE_GROUP_UTC && strncasecmp(id, "UTC", 3) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_AFRICA) && strncasecmp(id, "Africa/", 7) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_AMERICA) && strncasecmp(id, "America/", 8) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA) && strncasecmp(id, "Antarctica/", 11) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_ARCTIC) && strncasecmp(id, "Arctic/", 7) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_ASIA) && strncasecmp(id, "Asia/", 5) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_ATLANTIC) && strncasecmp(id, "Atlantic/", 9) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_AUSTRALIA) && strncasecmp(id, "Australia/", 10) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_EUROPE) && strncasecmp(id, "Europe/", 7) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_INDIAN) && strncasecmp(id, "Indian/", 7) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_PACIFIC) && strncasecmp(id, "Pacific/", 8) == 0) return 1;
+ if ((what & PHP_DATE_TIMEZONE_GROUP_UTC) && strncasecmp(id, "UTC", 3) == 0) return 1;
return 0;
} /* }}} */
}
zend_ffi_throw_parser_error("Incomplete type at line %d", FFI_G(line));
return FAILURE;
- } else if (!allow_incomplete_array && type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY) {
+ } else if (!allow_incomplete_array && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
zend_ffi_throw_parser_error("'[]' not allowed at line %d", FFI_G(line));
return FAILURE;
} else if (!FFI_G(allow_vla) && (type->attr & ZEND_FFI_ATTR_VLA)) {
#define MARIA_DB_VERSION_HACK_PREFIX "5.5.5-"
- if (conn->server_capabilities & CLIENT_PLUGIN_AUTH
+ if ((conn->server_capabilities & CLIENT_PLUGIN_AUTH)
&& !strncmp(p, MARIA_DB_VERSION_HACK_PREFIX, sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1))
{
p += sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1;
static void
MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode)
{
- if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) {
+ if ((mode & TRANS_COR_AND_CHAIN) && !(mode & TRANS_COR_AND_NO_CHAIN)) {
if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "AND CHAIN", sizeof("AND CHAIN") - 1);
- } else if (mode & TRANS_COR_AND_NO_CHAIN && !(mode & TRANS_COR_AND_CHAIN)) {
+ } else if ((mode & TRANS_COR_AND_NO_CHAIN) && !(mode & TRANS_COR_AND_CHAIN)) {
if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "AND NO CHAIN", sizeof("AND NO CHAIN") - 1);
}
- if (mode & TRANS_COR_RELEASE && !(mode & TRANS_COR_NO_RELEASE)) {
+ if ((mode & TRANS_COR_RELEASE) && !(mode & TRANS_COR_NO_RELEASE)) {
if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "RELEASE", sizeof("RELEASE") - 1);
- } else if (mode & TRANS_COR_NO_RELEASE && !(mode & TRANS_COR_RELEASE)) {
+ } else if ((mode & TRANS_COR_NO_RELEASE) && !(mode & TRANS_COR_RELEASE)) {
if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
/* EMPTY */ ; /* shut compiler's mouth */ \
} \
do { \
- if (((dbg_obj1) && (dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS) || \
- ((dbg_obj2) && (dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) \
+ if (((dbg_obj1) && ((dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) || \
+ ((dbg_obj2) && ((dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS))) \
{ \
DBG_PROFILE_START_TIME(); \
} \
} while (0);
-#define DBG_LEAVE_EX2(dbg_obj1, dbg_obj2, leave) \
- do {\
+#define DBG_LEAVE_EX2(dbg_obj1, dbg_obj2, leave) \
+ do { \
uint64_t this_call_duration = 0; \
- if (((dbg_obj1) && (dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS) || \
- ((dbg_obj2) && (dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) \
+ if (((dbg_obj1) && ((dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) || \
+ ((dbg_obj2) && ((dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS))) \
{ \
DBG_PROFILE_END_TIME(this_call_duration); \
} \
packet->response_code = uint1korr(p);
p++;
- if (packet->header.size == 1 && buf[0] == EODATA_MARKER && packet->server_capabilities & CLIENT_SECURE_CONNECTION) {
+ if (packet->header.size == 1 && buf[0] == EODATA_MARKER && (packet->server_capabilities & CLIENT_SECURE_CONNECTION)) {
/* We don't handle 3.23 authentication */
packet->server_asked_323_auth = TRUE;
DBG_RETURN(FAIL);
} else if (var->use_chain >= 0
|| var->phi_use_chain != NULL) {
if (value
- && opline->result_type & (IS_VAR|IS_TMP_VAR)
+ && (opline->result_type & (IS_VAR|IS_TMP_VAR))
&& opline->opcode != ZEND_QM_ASSIGN
&& opline->opcode != ZEND_ROPE_INIT
&& opline->opcode != ZEND_ROPE_ADD
if (opline->opcode == ZEND_DO_ICALL) {
removed_ops = remove_call(ctx, opline, ssa_op);
} else if (opline->opcode == ZEND_TYPE_CHECK
- && opline->op1_type & (IS_VAR|IS_TMP_VAR)
+ && (opline->op1_type & (IS_VAR|IS_TMP_VAR))
&& !value_known(&ctx->values[ssa_op->op1_use])) {
/* For TYPE_CHECK we may compute the result value without knowing the
* operand, based on type inference information. Make sure the operand is
return 1;
}
- if (flags & PDO_FETCH_GROUP && stmt->fetch.column == -1) {
+ if ((flags & PDO_FETCH_GROUP) && stmt->fetch.column == -1) {
colno = 1;
} else {
colno = stmt->fetch.column;
return NULL;
}
- if (!PHAR_G(cwd_init) && options & STREAM_OPEN_FOR_INCLUDE) {
+ if (!PHAR_G(cwd_init) && (options & STREAM_OPEN_FOR_INCLUDE)) {
char *entry = idata->internal_file->filename, *cwd;
PHAR_G(cwd_init) = 1;
return NULL;
}
- if (ssb.sb.st_mode & S_IFDIR && !dir) {
+ if ((ssb.sb.st_mode & S_IFDIR) && !dir) {
efree(test);
if (error) {
spprintf(error, 4096, "phar error: path \"%s\" is a directory", path);
zend_function *mptr;
ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) {
- if (mptr->common.fn_flags & ZEND_ACC_STATIC
+ if ((mptr->common.fn_flags & ZEND_ACC_STATIC)
&& ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
{
count_static_funcs++;
zend_function *mptr;
ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) {
- if (mptr->common.fn_flags & ZEND_ACC_STATIC
+ if ((mptr->common.fn_flags & ZEND_ACC_STATIC)
&& ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
{
smart_str_append_printf(str, "\n");
/* we need to check if the ctor is the ctor of the class level we we
* looking at since we might be looking at an inherited old style ctor
* defined in base class. */
- RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_CTOR && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope);
+ RETURN_BOOL((mptr->common.fn_flags & ZEND_ACC_CTOR) && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope);
}
/* }}} */
intern = Z_SPLDLLIST_P(ZEND_THIS);
- if (intern->flags & SPL_DLLIST_IT_FIX
+ if ((intern->flags & SPL_DLLIST_IT_FIX)
&& (intern->flags & SPL_DLLIST_IT_LIFO) != (value & SPL_DLLIST_IT_LIFO)) {
zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0);
RETURN_THROWS();
/* {{{ spl_add_class_name */
void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags)
{
- if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
+ if (!allow || (allow > 0 && (pce->ce_flags & ce_flags)) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
zval *tmp;
if ((tmp = zend_hash_find(Z_ARRVAL_P(list), pce->name)) == NULL) {
if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) {
BG(user_compare_fci) = *fci_data;
BG(user_compare_fci_cache) = *fci_data_cache;
- } else if (behavior & INTERSECT_ASSOC && key_compare_type == INTERSECT_COMP_KEY_USER) {
+ } else if ((behavior & INTERSECT_ASSOC) && key_compare_type == INTERSECT_COMP_KEY_USER) {
BG(user_compare_fci) = *fci_key;
BG(user_compare_fci_cache) = *fci_key_cache;
}
if (behavior == DIFF_NORMAL && data_compare_type == DIFF_COMP_DATA_USER) {
BG(user_compare_fci) = *fci_data;
BG(user_compare_fci_cache) = *fci_data_cache;
- } else if (behavior & DIFF_ASSOC && key_compare_type == DIFF_COMP_KEY_USER) {
+ } else if ((behavior & DIFF_ASSOC) && key_compare_type == DIFF_COMP_KEY_USER) {
BG(user_compare_fci) = *fci_key;
BG(user_compare_fci_cache) = *fci_key_cache;
}
RETURN_FALSE;
}
- if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) {
+ if ((flags & LOCK_EX) && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) {
php_stream_close(stream);
php_error_docref(NULL, E_WARNING, "Exclusive locks are not supported for this stream");
RETURN_FALSE;
ret = fcntl(fd, operation & LOCK_NB ? F_SETLK : F_SETLKW, &flck);
- if (operation & LOCK_NB && ret == -1 &&
+ if ((operation & LOCK_NB) && ret == -1 &&
(errno == EACCES || errno == EAGAIN))
errno = EWOULDBLOCK;
}
/* display/log the error if necessary */
- if (display && (EG(error_reporting) & type || (type & E_CORE))
+ if (display && ((EG(error_reporting) & type) || (type & E_CORE))
&& (PG(log_errors) || PG(display_errors) || (!module_initialized))) {
char *error_type_str;
int syslog_type_int = LOG_NOTICE;
ms->fsize = newsize;
return PHP_STREAM_OPTION_RETURN_OK;
}
- default:
- return PHP_STREAM_OPTION_RETURN_NOTIMPL;
}
+
+ return PHP_STREAM_OPTION_RETURN_NOTIMPL;
}
/* }}} */
(context)->notifier->mask |= PHP_STREAM_NOTIFIER_PROGRESS; \
php_stream_notify_progress((context), (sofar), (bmax)); } } while (0)
-#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && (context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS) { \
+#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && ((context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS)) { \
(context)->notifier->progress += (dsofar); \
(context)->notifier->progress_max += (dmax); \
php_stream_notify_progress((context), (context)->notifier->progress, (context)->notifier->progress_max); } } while (0)
#endif
}
}
+ return PHP_STREAM_OPTION_RETURN_NOTIMPL;
#ifdef PHP_WIN32
case PHP_STREAM_OPTION_PIPE_BLOCKING:
vspprintf(&buffer, 0, fmt, args);
va_end(args);
- if (options & REPORT_ERRORS || wrapper == NULL) {
+ if ((options & REPORT_ERRORS) || wrapper == NULL) {
php_error_docref(NULL, E_WARNING, "%s", buffer);
efree(buffer);
} else {
break;
}
- if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) {
+ if (!stream->readfilters.head && ((stream->flags & PHP_STREAM_FLAG_NO_BUFFER) || stream->chunk_size == 1)) {
toread = stream->ops->read(stream, buf, size);
if (toread < 0) {
/* Report an error if the read failed and we did not read any data
path_to_open = path;
wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options);
- if (options & STREAM_USE_URL && (!wrapper || !wrapper->is_url)) {
+ if ((options & STREAM_USE_URL) && (!wrapper || !wrapper->is_url)) {
php_error_docref(NULL, E_WARNING, "This function may only be used against URLs");
if (resolved_path) {
zend_string_release_ex(resolved_path, 0);
#endif
default:
- return PHP_STREAM_OPTION_RETURN_NOTIMPL;
+ break;
}
-
- default:
- return PHP_STREAM_OPTION_RETURN_NOTIMPL;
}
+
+ return PHP_STREAM_OPTION_RETURN_NOTIMPL;
}
static int php_sockop_cast(php_stream *stream, int castas, void **ret)
nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read);
if (nbytes_consumed != (size_t)nbytes_read) {
if (php_cli_server_log_level >= PHP_CLI_SERVER_LOG_ERROR) {
- if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
+ if ((buf[0] & 0x80) /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
*errstr = estrdup("Unsupported SSL request");
} else {
*errstr = estrdup("Malformed HTTP request");
nread = 0;
- if (parser->flags & F_UPGRADE || parser->method == PHP_HTTP_CONNECT) {
+ if ((parser->flags & F_UPGRADE) || parser->method == PHP_HTTP_CONNECT) {
parser->upgrade = 1;
}