summaryrefslogtreecommitdiff
path: root/ext/opcache/Optimizer
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/Optimizer')
-rw-r--r--ext/opcache/Optimizer/block_pass.c150
-rw-r--r--ext/opcache/Optimizer/compact_literals.c15
-rw-r--r--ext/opcache/Optimizer/dfa_pass.c5
-rw-r--r--ext/opcache/Optimizer/sccp.c9
-rw-r--r--ext/opcache/Optimizer/zend_dfg.c4
-rw-r--r--ext/opcache/Optimizer/zend_dump.c18
-rw-r--r--ext/opcache/Optimizer/zend_func_info.c1045
-rw-r--r--ext/opcache/Optimizer/zend_func_info.h5
-rw-r--r--ext/opcache/Optimizer/zend_inference.c197
-rw-r--r--ext/opcache/Optimizer/zend_inference.h10
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c10
-rw-r--r--ext/opcache/Optimizer/zend_ssa.c6
-rw-r--r--ext/opcache/Optimizer/zend_ssa.h1
13 files changed, 617 insertions, 858 deletions
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 3327ec86df..27622c08a9 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -33,27 +33,9 @@
/* Checks if a constant (like "true") may be replaced by its value */
int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy)
{
- zend_constant *c;
- char *lookup_name;
- int retval = 1;
- ALLOCA_FLAG(use_heap);
-
- if ((c = zend_hash_find_ptr(EG(zend_constants), name)) == NULL) {
- lookup_name = do_alloca(ZSTR_LEN(name) + 1, use_heap);
- memcpy(lookup_name, ZSTR_VAL(name), ZSTR_LEN(name) + 1);
- zend_str_tolower(lookup_name, ZSTR_LEN(name));
-
- if ((c = zend_hash_str_find_ptr(EG(zend_constants), lookup_name, ZSTR_LEN(name))) != NULL) {
- if (!(ZEND_CONSTANT_FLAGS(c) & CONST_CT_SUBST) || (ZEND_CONSTANT_FLAGS(c) & CONST_CS)) {
- retval = 0;
- }
- } else {
- retval = 0;
- }
- free_alloca(lookup_name, use_heap);
- }
-
- if (retval) {
+ zval *zv;
+ zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name);
+ if (c) {
if ((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)
&& (!(ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE)
|| !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE))) {
@@ -61,12 +43,19 @@ int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int
if (copy) {
Z_TRY_ADDREF_P(result);
}
+ return 1;
} else {
- retval = 0;
+ return 0;
}
}
- return retval;
+ /* Special constants null/true/false can always be substituted. */
+ zv = zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name));
+ if (zv) {
+ ZVAL_COPY_VALUE(result, zv);
+ return 1;
+ }
+ return 0;
}
/* CFG back references management */
@@ -76,8 +65,6 @@ int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int
/* Data dependencies macros */
-#define VAR_NUM_EX(op) VAR_NUM((op).var)
-
#define VAR_SOURCE(op) Tsource[VAR_NUM(op.var)]
#define SET_VAR_SOURCE(opline) Tsource[VAR_NUM(opline->result.var)] = opline
@@ -1089,7 +1076,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op
}
}
-static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_array, zend_cfg *cfg, zend_uchar *same_t, uint32_t *opt_count)
+static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_array, zend_cfg *cfg, uint32_t *opt_count)
{
/* last_op is the last opcode of the current block */
zend_basic_block *blocks = cfg->blocks;
@@ -1262,7 +1249,7 @@ static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_arr
if (1) {
zend_uchar same_type = last_op->op1_type;
- uint32_t same_var = VAR_NUM_EX(last_op->op1);
+ uint32_t same_var = last_op->op1.var;
zend_op *target;
zend_op *target_end;
zend_basic_block *target_block = blocks + block->successors[0];
@@ -1280,21 +1267,18 @@ next_target:
++(*opt_count);
goto next_target;
} else if (target->opcode == INV_COND(last_op->opcode) &&
+ same_var == target->op1.var &&
+ same_type == target->op1_type &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* JMPZ(X, L), L: JMPNZ(X, L2) -> JMPZ(X, L+1) */
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- same_type == target->op1_type &&
- same_var == VAR_NUM_EX(target->op1) &&
- !(target_block->flags & ZEND_BB_PROTECTED)
- ) {
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[1];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == INV_COND_EX(last_op->opcode) &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- same_type == target->op1_type &&
- same_var == VAR_NUM_EX(target->op1) &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ same_var == target->op1.var &&
+ same_type == target->op1_type &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* JMPZ(X, L), L: T = JMPNZ_EX(X, L2) -> T = JMPZ_EX(X, L+1) */
last_op->opcode += 3;
COPY_NODE(last_op->result, target->result);
@@ -1303,10 +1287,9 @@ next_target:
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == last_op->opcode &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- same_type == target->op1_type &&
- same_var == VAR_NUM_EX(target->op1) &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ same_var == target->op1.var &&
+ same_type == target->op1_type &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* JMPZ(X, L), L: JMPZ(X, L2) -> JMPZ(X, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[0];
@@ -1320,9 +1303,8 @@ next_target:
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == ZEND_JMPZNZ &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
+ same_var == target->op1.var &&
same_type == target->op1_type &&
- same_var == VAR_NUM_EX(target->op1) &&
!(target_block->flags & ZEND_BB_PROTECTED)) {
/* JMPZ(X, L), L: JMPZNZ(X, L2, L3) -> JMPZ(X, L2) */
DEL_SOURCE(block, block->successors[0]);
@@ -1403,14 +1385,10 @@ next_target:
if (1) {
zend_op *target, *target_end;
zend_basic_block *target_block;
- int var_num = op_array->last_var + op_array->T;
+ zend_uchar same_type = last_op->op1_type;
+ uint32_t same_var = last_op->op1.var;
+ uint32_t same_res_var = last_op->result.var;
- if (var_num <= 0) {
- return;
- }
- memset(same_t, 0, var_num);
- same_t[VAR_NUM_EX(last_op->op1)] |= last_op->op1_type;
- same_t[VAR_NUM_EX(last_op->result)] |= last_op->result_type;
target_block = blocks + block->successors[0];
next_target_ex:
target = op_array->opcodes + target_block->start;
@@ -1424,54 +1402,64 @@ next_target_ex:
++(*opt_count);
goto next_target_ex;
} else if (target->opcode == last_op->opcode-3 &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- (same_t[VAR_NUM_EX(target->op1)] & target->op1_type) != 0 &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ ((same_var == target->op1.var &&
+ same_type == target->op1_type) ||
+ (same_res_var == target->op1.var &&
+ target->op1_type == IS_TMP_VAR)) &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* T = JMPZ_EX(X, L1), L1: JMPZ({X|T}, L2) -> T = JMPZ_EX(X, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[0];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == INV_EX_COND(last_op->opcode) &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- (same_t[VAR_NUM_EX(target->op1)] & target->op1_type) != 0 &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ ((same_var == target->op1.var &&
+ same_type == target->op1_type) ||
+ (same_res_var == target->op1.var &&
+ target->op1_type == IS_TMP_VAR)) &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* T = JMPZ_EX(X, L1), L1: JMPNZ({X|T1}, L2) -> T = JMPZ_EX(X, L1+1) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[1];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == INV_EX_COND_EX(last_op->opcode) &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- (same_t[VAR_NUM_EX(target->op1)] & target->op1_type) != 0 &&
- (same_t[VAR_NUM_EX(target->result)] & target->result_type) != 0 &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
- /* T = JMPZ_EX(X, L1), L1: T = JMPNZ_EX(T, L2) -> T = JMPZ_EX(X, L1+1) */
+ same_res_var == target->result.var &&
+ ((same_var == target->op1.var &&
+ same_type == target->op1_type) ||
+ (same_res_var == target->op1.var &&
+ target->op1_type == IS_TMP_VAR)) &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
+ /* T = JMPZ_EX(X, L1), L1: T = JMPNZ_EX({X|T}, L2) -> T = JMPZ_EX(X, L1+1) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[1];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == last_op->opcode &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- (same_t[VAR_NUM_EX(target->op1)] & target->op1_type) != 0 &&
- (same_t[VAR_NUM_EX(target->result)] & target->result_type) != 0 &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
- /* T = JMPZ_EX(X, L1), L1: T = JMPZ({X|T}, L2) -> T = JMPZ_EX(X, L2) */
+ same_res_var == target->result.var &&
+ ((same_var == target->op1.var &&
+ same_type == target->op1_type) ||
+ (same_res_var == target->op1.var &&
+ target->op1_type == IS_TMP_VAR)) &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
+ /* T = JMPZ_EX(X, L1), L1: T = JMPZ_EX({X|T}, L2) -> T = JMPZ_EX(X, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[0];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == ZEND_JMP &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* T = JMPZ_EX(X, L), L: JMP(L2) -> T = JMPZ(X, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[0];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == ZEND_JMPZNZ &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- (same_t[VAR_NUM_EX(target->op1)] & target->op1_type) != 0 &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ ((same_var == target->op1.var &&
+ same_type == target->op1_type) ||
+ (same_res_var == target->op1.var &&
+ target->op1_type == IS_TMP_VAR)) &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* T = JMPZ_EX(X, L), L: JMPZNZ({X|T}, L2, L3) -> T = JMPZ_EX(X, L2) */
DEL_SOURCE(block, block->successors[0]);
if (last_op->opcode == ZEND_JMPZ_EX) {
@@ -1541,7 +1529,7 @@ next_target_ex:
if (last_op->opcode == ZEND_JMPZNZ) {
zend_uchar same_type = last_op->op1_type;
- zend_uchar same_var = VAR_NUM_EX(last_op->op1);
+ zend_uchar same_var = last_op->op1.var;
zend_op *target;
zend_op *target_end;
zend_basic_block *target_block = blocks + block->successors[0];
@@ -1558,28 +1546,26 @@ next_target_znz:
++(*opt_count);
goto next_target_znz;
} else if ((target->opcode == ZEND_JMPZ || target->opcode == ZEND_JMPZNZ) &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- same_type == target->op1_type &&
- same_var == VAR_NUM_EX(target->op1) &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
+ same_var == target->op1.var &&
+ same_type == target->op1_type &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
/* JMPZNZ(X, L1, L2), L1: JMPZ(X, L3) -> JMPZNZ(X, L3, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[0];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == ZEND_JMPNZ &&
- (target->op1_type & (IS_TMP_VAR|IS_CV)) &&
- same_type == target->op1_type &&
- same_var == VAR_NUM_EX(target->op1) &&
- !(target_block->flags & ZEND_BB_PROTECTED)) {
- /* JMPZNZ(X, L1, L2), L1: X = JMPNZ(X, L3) -> JMPZNZ(X, L1+1, L2) */
+ same_var == target->op1.var &&
+ same_type == target->op1_type &&
+ !(target_block->flags & ZEND_BB_PROTECTED)) {
+ /* JMPZNZ(X, L1, L2), L1: X = JMPNZ(X, L3) -> JMPZNZ(X, L1+1, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[1];
ADD_SOURCE(block, block->successors[0]);
++(*opt_count);
} else if (target->opcode == ZEND_JMP &&
!(target_block->flags & ZEND_BB_PROTECTED)) {
- /* JMPZNZ(X, L1, L2), L1: JMP(L3) -> JMPZNZ(X, L3, L2) */
+ /* JMPZNZ(X, L1, L2), L1: JMP(L3) -> JMPZNZ(X, L3, L2) */
DEL_SOURCE(block, block->successors[0]);
block->successors[0] = target_block->successors[0];
ADD_SOURCE(block, block->successors[0]);
@@ -1884,7 +1870,6 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
zend_bitset usage;
void *checkpoint;
zend_op **Tsource;
- zend_uchar *same_t;
uint32_t opt_count;
/* Build CFG */
@@ -1905,7 +1890,6 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
bitset_len = zend_bitset_len(op_array->last_var + op_array->T);
Tsource = zend_arena_calloc(&ctx->arena, op_array->last_var + op_array->T, sizeof(zend_op *));
- same_t = zend_arena_alloc(&ctx->arena, op_array->last_var + op_array->T);
usage = zend_arena_alloc(&ctx->arena, bitset_len * ZEND_BITSET_ELM_SIZE);
blocks = cfg.blocks;
@@ -1941,7 +1925,7 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
/* Jump optimization for each block */
for (b = blocks; b < end; b++) {
if (b->flags & ZEND_BB_REACHABLE) {
- zend_jmp_optimization(b, op_array, &cfg, same_t, &opt_count);
+ zend_jmp_optimization(b, op_array, &cfg, &opt_count);
}
}
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index f754dbaa44..0a99ac4140 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -168,13 +168,13 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
LITERAL_INFO(opline->op1.constant, LITERAL_CLASS, 2);
break;
case ZEND_DEFINED:
- LITERAL_INFO(opline->op1.constant, LITERAL_CONST, 2);
+ LITERAL_INFO(opline->op1.constant, LITERAL_CONST, 1);
break;
case ZEND_FETCH_CONSTANT:
- if ((opline->op1.num & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
- LITERAL_INFO(opline->op2.constant, LITERAL_CONST, 5);
- } else {
+ if (opline->op1.num & IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE) {
LITERAL_INFO(opline->op2.constant, LITERAL_CONST, 3);
+ } else {
+ LITERAL_INFO(opline->op2.constant, LITERAL_CONST, 2);
}
break;
case ZEND_FETCH_CLASS_CONSTANT:
@@ -503,15 +503,10 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
}
switch (opline->opcode) {
case ZEND_RECV_INIT:
- if (class_name_type_hint(op_array, opline->op1.num)) {
- opline->extended_value = cache_size;
- cache_size += sizeof(void *);
- }
- break;
case ZEND_RECV:
case ZEND_RECV_VARIADIC:
if (class_name_type_hint(op_array, opline->op1.num)) {
- opline->op2.num = cache_size;
+ opline->extended_value = cache_size;
cache_size += sizeof(void *);
}
break;
diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c
index 5401c9df6a..5ea7775921 100644
--- a/ext/opcache/Optimizer/dfa_pass.c
+++ b/ext/opcache/Optimizer/dfa_pass.c
@@ -312,6 +312,8 @@ static inline zend_bool can_elide_return_type_check(
zend_ssa_var_info *use_info = &ssa->var_info[ssa_op->op1_use];
zend_ssa_var_info *def_info = &ssa->var_info[ssa_op->op1_def];
+ /* TODO: It would be better to rewrite this without using def_info,
+ * which may not be an exact representation of the type. */
if (use_info->type & MAY_BE_REF) {
return 0;
}
@@ -322,7 +324,8 @@ static inline zend_bool can_elide_return_type_check(
}
/* These types are not represented exactly */
- if (ZEND_TYPE_CODE(info->type) == IS_CALLABLE || ZEND_TYPE_CODE(info->type) == IS_ITERABLE) {
+ if (ZEND_TYPE_IS_MASK(info->type)
+ && (ZEND_TYPE_MASK(info->type) & (MAY_BE_CALLABLE|MAY_BE_ITERABLE))) {
return 0;
}
diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c
index 6f8de3d43f..021b15ba32 100644
--- a/ext/opcache/Optimizer/sccp.c
+++ b/ext/opcache/Optimizer/sccp.c
@@ -892,8 +892,7 @@ static inline int ct_eval_func_call(
} else if (zend_string_equals_literal(name, "strpos")) {
if (Z_TYPE_P(args[0]) != IS_STRING
|| Z_TYPE_P(args[1]) != IS_STRING
- || !Z_STRLEN_P(args[1])
- || (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
+ || !Z_STRLEN_P(args[1])) {
return FAILURE;
}
/* pass */
@@ -972,8 +971,7 @@ static inline int ct_eval_func_call(
/* pass */
} else if (zend_string_equals_literal(name, "substr")) {
if (Z_TYPE_P(args[0]) != IS_STRING
- || Z_TYPE_P(args[1]) != IS_LONG
- || (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
+ || Z_TYPE_P(args[1]) != IS_LONG) {
return FAILURE;
}
/* pass */
@@ -1017,8 +1015,7 @@ static inline int ct_eval_func_call(
} else if (zend_string_equals_literal(name, "substr")) {
if (Z_TYPE_P(args[0]) != IS_STRING
|| Z_TYPE_P(args[1]) != IS_LONG
- || Z_TYPE_P(args[2]) != IS_LONG
- || (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
+ || Z_TYPE_P(args[2]) != IS_LONG) {
return FAILURE;
}
/* pass */
diff --git a/ext/opcache/Optimizer/zend_dfg.c b/ext/opcache/Optimizer/zend_dfg.c
index e995b673b7..3bb76fb05c 100644
--- a/ext/opcache/Optimizer/zend_dfg.c
+++ b/ext/opcache/Optimizer/zend_dfg.c
@@ -123,10 +123,6 @@ int zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
case ZEND_FETCH_DIM_UNSET:
- case ZEND_FETCH_OBJ_W:
- case ZEND_FETCH_OBJ_RW:
- case ZEND_FETCH_OBJ_FUNC_ARG:
- case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_LIST_W:
case ZEND_VERIFY_RETURN_TYPE:
case ZEND_PRE_INC_OBJ:
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c
index d6ef63415a..d10e7f989e 100644
--- a/ext/opcache/Optimizer/zend_dump.c
+++ b/ext/opcache/Optimizer/zend_dump.c
@@ -127,11 +127,8 @@ static void zend_dump_unused_op(const zend_op *opline, znode_op op, uint32_t fla
} else if (ZEND_VM_OP_CONSTRUCTOR == (flags & ZEND_VM_OP_MASK)) {
fprintf(stderr, " CONSTRUCTOR");
} else if (ZEND_VM_OP_CONST_FETCH == (flags & ZEND_VM_OP_MASK)) {
- if (op.num & IS_CONSTANT_UNQUALIFIED) {
- fprintf(stderr, " (unqualified)");
- }
- if (op.num & IS_CONSTANT_IN_NAMESPACE) {
- fprintf(stderr, " (in-namespace)");
+ if (op.num & IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE) {
+ fprintf(stderr, " (unqualified-in-namespace)");
}
}
}
@@ -314,10 +311,6 @@ static void zend_dump_type_info(uint32_t info, zend_class_entry *ce, int is_inst
fprintf(stderr, "resource");
}
}
- if (info & MAY_BE_ERROR) {
- if (first) first = 0; else fprintf(stderr, ", ");
- fprintf(stderr, "error");
- }
//TODO: this is useful only for JIT???
if (info & MAY_BE_IN_REG) {
if (first) first = 0; else fprintf(stderr, ", ");
@@ -581,14 +574,12 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *
fprintf(stderr, " (ref)");
}
}
- if ((ZEND_VM_EXT_DIM_OBJ_WRITE|ZEND_VM_EXT_FETCH_REF) & flags) {
+ if ((ZEND_VM_EXT_DIM_WRITE|ZEND_VM_EXT_FETCH_REF) & flags) {
uint32_t obj_flags = opline->extended_value & ZEND_FETCH_OBJ_FLAGS;
if (obj_flags == ZEND_FETCH_REF) {
fprintf(stderr, " (ref)");
} else if (obj_flags == ZEND_FETCH_DIM_WRITE) {
fprintf(stderr, " (dim write)");
- } else if (obj_flags == ZEND_FETCH_OBJ_WRITE) {
- fprintf(stderr, " (obj write)");
}
}
}
@@ -729,6 +720,9 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags
if (b->flags & ZEND_BB_START) {
fprintf(stderr, " start");
}
+ if (b->flags & ZEND_BB_RECV_ENTRY) {
+ fprintf(stderr, " recv");
+ }
if (b->flags & ZEND_BB_FOLLOW) {
fprintf(stderr, " follow");
}
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index d9ff58e75e..4c7a439e7a 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -39,66 +39,19 @@ typedef struct _func_info_t {
info_func_t info_func;
} func_info_t;
-/* MSVC defines its own IN macro, undefine it here */
-#undef IN
-
#define F0(name, info) \
- {name, sizeof(name)-1, (FUNC_MAY_WARN | (info)), NULL}
+ {name, sizeof(name)-1, (info), NULL}
#define F1(name, info) \
- {name, sizeof(name)-1, (FUNC_MAY_WARN | MAY_BE_RC1 | (info)), NULL}
+ {name, sizeof(name)-1, (MAY_BE_RC1 | (info)), NULL}
#define FN(name, info) \
- {name, sizeof(name)-1, (FUNC_MAY_WARN | MAY_BE_RC1 | MAY_BE_RCN | (info)), NULL}
+ {name, sizeof(name)-1, (MAY_BE_RC1 | MAY_BE_RCN | (info)), NULL}
#define FR(name, info) \
- {name, sizeof(name)-1, (FUNC_MAY_WARN | MAY_BE_REF | (info)), NULL}
+ {name, sizeof(name)-1, (MAY_BE_REF | (info)), NULL}
#define FX(name, info) \
- {name, sizeof(name)-1, (FUNC_MAY_WARN | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | (info)), NULL}
-#define I0(name, info) \
- {name, sizeof(name)-1, (info), NULL}
-#define I1(name, info) \
- {name, sizeof(name)-1, (MAY_BE_RC1 | (info)), NULL}
-#define IN(name, info) \
- {name, sizeof(name)-1, (MAY_BE_RC1 | MAY_BE_RCN | (info)), NULL}
+ {name, sizeof(name)-1, (MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | (info)), NULL}
#define FC(name, callback) \
{name, sizeof(name)-1, 0, callback}
-static uint32_t zend_strlen_info(const zend_call_info *call_info, const zend_ssa *ssa)
-{
- if (call_info->num_args == 1) {
- uint32_t tmp = 0;
- if (call_info->arg_info[0].opline) {
- uint32_t arg_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
-
- if (arg_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT)) {
- tmp |= MAY_BE_LONG;
- }
- if (arg_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
- /* warning, and returns NULL */
- tmp |= FUNC_MAY_WARN | MAY_BE_NULL;
- }
- } else {
- tmp |= MAY_BE_LONG | FUNC_MAY_WARN | MAY_BE_NULL;
- }
- return tmp;
- } else if (call_info->num_args != -1) {
- /* warning, and returns NULL */
- return FUNC_MAY_WARN | MAY_BE_NULL;
- } else {
- return MAY_BE_LONG | FUNC_MAY_WARN | MAY_BE_NULL;
- }
-}
-
-static uint32_t zend_dechex_info(const zend_call_info *call_info, const zend_ssa *ssa)
-{
- if (call_info->num_args == 1) {
- return MAY_BE_RC1 | MAY_BE_STRING;
- } else if (call_info->num_args != -1) {
- /* warning, and returns NULL */
- return FUNC_MAY_WARN | MAY_BE_NULL;
- } else {
- return FUNC_MAY_WARN | MAY_BE_RC1 | MAY_BE_STRING | MAY_BE_NULL;
- }
-}
-
static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
if (call_info->num_args == 2 || call_info->num_args == 3) {
@@ -106,7 +59,7 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
uint32_t t1 = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
uint32_t t2 = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
uint32_t t3 = 0;
- uint32_t tmp = FUNC_MAY_WARN | MAY_BE_RC1 | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG;
+ uint32_t tmp = MAY_BE_RC1 | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG;
if (call_info->num_args == 3) {
t3 = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[2].opline);
@@ -127,87 +80,7 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
return tmp;
} else {
/* may warning, and return FALSE */
- return FUNC_MAY_WARN | MAY_BE_RC1 | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING;
- }
-}
-
-static uint32_t zend_is_type_info(const zend_call_info *call_info, const zend_ssa *ssa)
-{
- if (call_info->num_args == 1) {
- return MAY_BE_FALSE | MAY_BE_TRUE;
- } else {
- return MAY_BE_FALSE | MAY_BE_TRUE | FUNC_MAY_WARN;
- }
-}
-
-static uint32_t zend_l_ss_info(const zend_call_info *call_info, const zend_ssa *ssa)
-{
- if (call_info->num_args == 2) {
-
- uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
- uint32_t arg2_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
- uint32_t tmp = 0;
-
- if ((arg1_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT)) &&
- (arg2_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT))) {
- tmp |= MAY_BE_LONG;
- }
- if ((arg1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) ||
- (arg2_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
- /* warning, and returns NULL */
- tmp |= FUNC_MAY_WARN | MAY_BE_NULL;
- }
- return tmp;
- } else {
- /* warning, and returns NULL */
- return FUNC_MAY_WARN | MAY_BE_NULL | MAY_BE_LONG;
- }
-}
-
-static uint32_t zend_lb_ssn_info(const zend_call_info *call_info, const zend_ssa *ssa)
-{
- if (call_info->num_args == 3) {
- uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
- uint32_t arg2_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
- uint32_t arg3_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[2].opline);
- uint32_t tmp = 0;
-
- if ((arg1_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT)) &&
- (arg2_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT)) &&
- (arg3_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT))) {
- tmp |= MAY_BE_LONG | MAY_BE_FALSE;
- }
- if ((arg1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) ||
- (arg2_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) ||
- (arg3_info & (MAY_BE_STRING|MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT))) {
- /* warning, and returns NULL */
- tmp |= FUNC_MAY_WARN | MAY_BE_NULL;
- }
- return tmp;
- } else {
- /* warning, and returns NULL */
- return FUNC_MAY_WARN | MAY_BE_NULL | MAY_BE_LONG;
- }
-}
-
-static uint32_t zend_b_s_info(const zend_call_info *call_info, const zend_ssa *ssa)
-{
- if (call_info->num_args == 1) {
-
- uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
- uint32_t tmp = 0;
-
- if (arg1_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT)) {
- tmp |= MAY_BE_FALSE | MAY_BE_TRUE;
- }
- if (arg1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
- /* warning, and returns NULL */
- tmp |= FUNC_MAY_WARN | MAY_BE_NULL;
- }
- return tmp;
- } else {
- /* warning, and returns NULL */
- return FUNC_MAY_WARN | MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE;
+ return MAY_BE_RC1 | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING;
}
}
@@ -215,191 +88,189 @@ static uint32_t zend_b_s_info(const zend_call_info *call_info, const zend_ssa *s
static const func_info_t func_infos[] = {
/* zend */
- I1("zend_version", MAY_BE_STRING),
- I0("gc_collect_cycles", MAY_BE_LONG),
- I0("gc_enabled", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("zend_version", MAY_BE_STRING),
+ F0("gc_collect_cycles", MAY_BE_LONG),
+ F0("gc_enabled", MAY_BE_FALSE | MAY_BE_TRUE),
F0("gc_enable", MAY_BE_NULL),
F0("gc_disable", MAY_BE_NULL),
F0("func_num_args", MAY_BE_LONG),
FN("func_get_arg", UNKNOWN_INFO),
F1("func_get_args", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
- FC("strlen", zend_strlen_info),
- FC("strcmp", zend_l_ss_info),
- FC("strncmp", zend_lb_ssn_info),
- FC("strcasecmp", zend_l_ss_info),
- FC("strncasecmp", zend_lb_ssn_info),
- F1("each", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_KEY_ANY),
- F0("error_reporting", MAY_BE_NULL | MAY_BE_LONG),
+ F0("strlen", MAY_BE_LONG),
+ F0("strcmp", MAY_BE_LONG),
+ F0("strncmp", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("strcasecmp", MAY_BE_LONG),
+ F0("strncasecmp", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("error_reporting", MAY_BE_LONG),
F0("define", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_NULL), // TODO: inline
- FC("defined", zend_b_s_info), // TODO: inline
+ F0("defined", MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
FN("get_class", MAY_BE_FALSE | MAY_BE_STRING),
FN("get_called_class", MAY_BE_FALSE | MAY_BE_STRING),
- FN("get_parent_class", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_NULL),
- F0("is_subclass_of", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
- F0("is_a", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
- F1("get_class_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
- FN("get_object_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
- FN("get_mangled_object_vars", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
+ FN("get_parent_class", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("is_subclass_of", MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
+ F0("is_a", MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
+ F1("get_class_vars", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
+ FN("get_object_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
+ FN("get_mangled_object_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
F1("get_class_methods", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F0("method_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("method_exists", MAY_BE_FALSE | MAY_BE_TRUE),
F0("property_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("class_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("interface_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("trait_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- FC("function_exists", zend_b_s_info), // TODO: inline
- F0("class_alias", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- I1("get_included_files", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F0("trigger_error", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("user_error", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("class_exists", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("interface_exists", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("trait_exists", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("function_exists", MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
+ F0("class_alias", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("get_included_files", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("trigger_error", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("user_error", MAY_BE_FALSE | MAY_BE_TRUE),
FN("set_error_handler", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT),
- I0("restore_error_handler", MAY_BE_TRUE),
- I0("restore_exception_handler", MAY_BE_TRUE),
- I1("get_declared_traits", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- I1("get_declared_classes", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- I1("get_declared_interfaces", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("restore_error_handler", MAY_BE_TRUE),
+ F0("restore_exception_handler", MAY_BE_TRUE),
+ F1("get_declared_traits", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("get_declared_classes", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("get_declared_interfaces", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("get_defined_functions", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
- I1("get_defined_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
- FN("create_function", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
- F1("get_resource_type", MAY_BE_NULL | MAY_BE_STRING),
- F1("get_defined_constants", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_RESOURCE | MAY_BE_ARRAY_OF_ARRAY),
+ F1("get_defined_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
+ F1("get_resource_type", MAY_BE_STRING),
+ F1("get_defined_constants", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_RESOURCE | MAY_BE_ARRAY_OF_ARRAY),
F0("debug_print_backtrace", MAY_BE_NULL),
- F1("debug_backtrace", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
- F1("get_loaded_extensions", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- FC("extension_loaded", zend_b_s_info),
- F1("get_extension_funcs", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("debug_backtrace", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
+ F1("get_loaded_extensions", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("extension_loaded", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("get_extension_funcs", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
/* ext/standard */
FN("constant", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
- F1("bin2hex", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("hex2bin", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("bin2hex", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("hex2bin", MAY_BE_FALSE | MAY_BE_STRING),
F0("sleep", MAY_BE_FALSE | MAY_BE_LONG),
F0("usleep", MAY_BE_NULL | MAY_BE_FALSE),
#if HAVE_NANOSLEEP
- F0("time_nanosleep", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
- F0("time_sleep_until", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("time_nanosleep", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
+ F0("time_sleep_until", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
#if HAVE_STRPTIME
- F1("strptime", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("strptime", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
#endif
F0("flush", MAY_BE_NULL),
- F1("wordwrap", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("htmlspecialchars", MAY_BE_NULL | MAY_BE_STRING),
- F1("htmlentities", MAY_BE_NULL | MAY_BE_STRING),
- FN("html_entity_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- FN("htmlspecialchars_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("get_html_translation_table", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
- F1("sha1", MAY_BE_NULL | MAY_BE_STRING),
- F1("sha1_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("md5", MAY_BE_NULL | MAY_BE_STRING),
- F1("md5_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("crc32", MAY_BE_NULL | MAY_BE_LONG),
- F1("iptcparse", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
- F1("iptcembed", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("getimagesize", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("getimagesizefromstring", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("image_type_to_mime_type", MAY_BE_NULL | MAY_BE_STRING),
+ F1("wordwrap", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("htmlspecialchars", MAY_BE_STRING),
+ F1("htmlentities", MAY_BE_STRING),
+ FN("html_entity_decode", MAY_BE_FALSE | MAY_BE_STRING),
+ FN("htmlspecialchars_decode", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("get_html_translation_table", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
+ F1("sha1", MAY_BE_STRING),
+ F1("sha1_file", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("md5", MAY_BE_STRING),
+ F1("md5_file", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("crc32", MAY_BE_LONG),
+ F1("iptcparse", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F1("iptcembed", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("getimagesize", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("getimagesizefromstring", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("image_type_to_mime_type", MAY_BE_STRING),
F1("image_type_to_extension", MAY_BE_FALSE | MAY_BE_STRING),
- F0("phpinfo", MAY_BE_NULL | MAY_BE_TRUE),
- F1("phpversion", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("phpcredits", MAY_BE_NULL | MAY_BE_TRUE),
- I1("php_sapi_name", MAY_BE_FALSE | MAY_BE_STRING),
- F1("php_uname", MAY_BE_NULL | MAY_BE_STRING),
- I1("php_ini_scanned_files", MAY_BE_FALSE | MAY_BE_STRING),
- I1("php_ini_loaded_file", MAY_BE_FALSE | MAY_BE_STRING),
- F0("strnatcmp", MAY_BE_NULL | MAY_BE_LONG),
- F0("strnatcasecmp", MAY_BE_NULL | MAY_BE_LONG),
- F0("substr_count", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("strspn", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("strcspn", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F1("strtok", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- FN("strtoupper", MAY_BE_NULL | MAY_BE_STRING),
- FN("strtolower", MAY_BE_NULL | MAY_BE_STRING),
- F0("strpos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("stripos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("strrpos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("strripos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F1("strrev", MAY_BE_NULL | MAY_BE_STRING),
- F1("hebrev", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("hebrevc", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("nl2br", MAY_BE_NULL | MAY_BE_STRING),
- F1("basename", MAY_BE_NULL | MAY_BE_STRING),
+ F0("phpinfo", MAY_BE_TRUE),
+ F1("phpversion", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("phpcredits", MAY_BE_TRUE),
+ F1("php_sapi_name", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("php_uname", MAY_BE_STRING),
+ F1("php_ini_scanned_files", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("php_ini_loaded_file", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("strnatcmp", MAY_BE_LONG),
+ F0("strnatcasecmp", MAY_BE_LONG),
+ F0("substr_count", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("strspn", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("strcspn", MAY_BE_FALSE | MAY_BE_LONG),
+ F1("strtok", MAY_BE_FALSE | MAY_BE_STRING),
+ FN("strtoupper", MAY_BE_STRING),
+ FN("strtolower", MAY_BE_STRING),
+ F0("strpos", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("stripos", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("strrpos", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("strripos", MAY_BE_FALSE | MAY_BE_LONG),
+ F1("strrev", MAY_BE_STRING),
+ F1("hebrev", MAY_BE_STRING),
+ F1("hebrevc", MAY_BE_STRING),
+ FN("nl2br", MAY_BE_STRING),
+ F1("basename", MAY_BE_STRING),
F1("dirname", MAY_BE_NULL | MAY_BE_STRING),
- F1("pathinfo", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
- F1("stripslashes", MAY_BE_NULL | MAY_BE_STRING),
- F1("stripcslashes", MAY_BE_NULL | MAY_BE_STRING),
- F1("strstr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("stristr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("strrchr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("str_shuffle", MAY_BE_NULL | MAY_BE_STRING),
- F1("str_word_count", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("str_split", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("pathinfo", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
+ F1("stripslashes", MAY_BE_STRING),
+ F1("stripcslashes", MAY_BE_STRING),
+ F1("strstr", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("stristr", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("strrchr", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("str_shuffle", MAY_BE_STRING),
+ F1("str_word_count", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("str_split", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
F0("substr_compare", MAY_BE_FALSE | MAY_BE_LONG),
- F0("strcoll", MAY_BE_NULL | MAY_BE_LONG),
+ F0("strcoll", MAY_BE_LONG),
#ifdef HAVE_STRFMON
- F1("money_format", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("money_format", MAY_BE_FALSE | MAY_BE_STRING),
#endif
- FN("substr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- FN("substr_replace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
- F1("quotemeta", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- FN("ucfirst", MAY_BE_NULL | MAY_BE_STRING),
- FN("lcfirst", MAY_BE_NULL | MAY_BE_STRING),
- F1("ucwords", MAY_BE_NULL | MAY_BE_STRING),
- FN("strtr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- FN("addslashes", MAY_BE_NULL | MAY_BE_STRING),
- F1("addcslashes", MAY_BE_NULL | MAY_BE_STRING),
- FN("rtrim", MAY_BE_NULL | MAY_BE_STRING),
- FN("str_replace", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
- FN("str_ireplace", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
+ FN("substr", MAY_BE_FALSE | MAY_BE_STRING),
+ FN("substr_replace", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
+ F1("quotemeta", MAY_BE_STRING),
+ FN("ucfirst", MAY_BE_STRING),
+ FN("lcfirst", MAY_BE_STRING),
+ F1("ucwords", MAY_BE_STRING),
+ FN("strtr", MAY_BE_FALSE | MAY_BE_STRING),
+ FN("addslashes", MAY_BE_STRING),
+ F1("addcslashes", MAY_BE_STRING),
+ FN("rtrim", MAY_BE_STRING),
+ FN("chop", MAY_BE_STRING),
+ FN("str_replace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
+ FN("str_ireplace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
F1("str_repeat", MAY_BE_NULL | MAY_BE_STRING),
- F1("count_chars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
- F1("chunk_split", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- FN("trim", MAY_BE_NULL | MAY_BE_STRING),
- FN("ltrim", MAY_BE_NULL | MAY_BE_STRING),
- F1("strip_tags", MAY_BE_NULL | MAY_BE_STRING),
- F0("similar_text", MAY_BE_NULL | MAY_BE_LONG),
- F1("explode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- FN("implode", MAY_BE_NULL | MAY_BE_STRING),
- FN("join", MAY_BE_NULL | MAY_BE_STRING),
- FN("setlocale", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("count_chars", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F1("chunk_split", MAY_BE_FALSE | MAY_BE_STRING),
+ FN("trim", MAY_BE_STRING),
+ FN("ltrim", MAY_BE_STRING),
+ F1("strip_tags", MAY_BE_STRING),
+ F0("similar_text", MAY_BE_LONG),
+ F1("explode", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ FN("implode", MAY_BE_STRING),
+ FN("join", MAY_BE_STRING),
+ FN("setlocale", MAY_BE_FALSE | MAY_BE_STRING),
F1("localeconv", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#if HAVE_NL_LANGINFO
- F1("nl_langinfo", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("nl_langinfo", MAY_BE_FALSE | MAY_BE_STRING),
#endif
- F1("soundex", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("levenshtein", MAY_BE_NULL | MAY_BE_LONG),
- F1("chr", MAY_BE_NULL | MAY_BE_STRING),
- F0("ord", MAY_BE_NULL | MAY_BE_LONG),
+ F1("soundex", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("levenshtein", MAY_BE_LONG),
+ F1("chr", MAY_BE_STRING),
+ F0("ord", MAY_BE_LONG),
F0("parse_str", MAY_BE_NULL),
F1("str_getcsv", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
F1("str_pad", MAY_BE_NULL | MAY_BE_STRING),
- F1("chop", MAY_BE_NULL | MAY_BE_STRING),
- F1("strchr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("strchr", MAY_BE_FALSE | MAY_BE_STRING),
F1("sprintf", MAY_BE_FALSE | MAY_BE_STRING),
F0("printf", MAY_BE_FALSE | MAY_BE_LONG),
F0("vprintf", MAY_BE_FALSE | MAY_BE_LONG),
F1("vsprintf", MAY_BE_FALSE | MAY_BE_STRING),
- F0("fprintf", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("vfprintf", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("fprintf", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("vfprintf", MAY_BE_FALSE | MAY_BE_LONG),
F1("sscanf", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
F1("fscanf", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
- F1("parse_url", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_LONG),
- F1("urlencode", MAY_BE_NULL | MAY_BE_STRING),
- F1("urldecode", MAY_BE_NULL | MAY_BE_STRING),
- F1("rawurlencode", MAY_BE_NULL | MAY_BE_STRING),
- F1("rawurldecode", MAY_BE_NULL | MAY_BE_STRING),
+ F1("parse_url", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_LONG),
+ F1("urlencode", MAY_BE_STRING),
+ F1("urldecode", MAY_BE_STRING),
+ F1("rawurlencode", MAY_BE_STRING),
+ F1("rawurldecode", MAY_BE_STRING),
F1("http_build_query", MAY_BE_FALSE | MAY_BE_STRING),
#if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
- F1("readlink", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("linkinfo", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("symlink", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("link", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("readlink", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("linkinfo", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("symlink", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("link", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F0("unlink", MAY_BE_FALSE | MAY_BE_TRUE),
F1("exec", MAY_BE_FALSE | MAY_BE_STRING),
F1("system", MAY_BE_FALSE | MAY_BE_STRING),
- F1("escapeshellcmd", MAY_BE_NULL | MAY_BE_STRING),
- F1("escapeshellarg", MAY_BE_NULL | MAY_BE_STRING),
+ F1("escapeshellcmd", MAY_BE_STRING),
+ F1("escapeshellarg", MAY_BE_STRING),
F1("passthru", MAY_BE_NULL | MAY_BE_FALSE),
F1("shell_exec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
@@ -418,111 +289,111 @@ static const func_info_t func_infos[] = {
F0("getrandmax", MAY_BE_NULL | MAY_BE_LONG),
F0("mt_rand", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("mt_srand", MAY_BE_NULL),
- I0("mt_getrandmax", MAY_BE_LONG),
+ F0("mt_getrandmax", MAY_BE_LONG),
#if HAVE_GETSERVBYNAME
- F0("getservbyname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getservbyname", MAY_BE_FALSE | MAY_BE_LONG),
#endif
#if HAVE_GETSERVBYPORT
- F1("getservbyport", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("getservbyport", MAY_BE_FALSE | MAY_BE_STRING),
#endif
#if HAVE_GETPROTOBYNAME
- F0("getprotobyname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getprotobyname", MAY_BE_FALSE | MAY_BE_LONG),
#endif
#if HAVE_GETPROTOBYNUMBER
- F1("getprotobynumber", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("getprotobynumber", MAY_BE_FALSE | MAY_BE_STRING),
#endif
F0("getmyuid", MAY_BE_FALSE | MAY_BE_LONG),
F0("getmygid", MAY_BE_FALSE | MAY_BE_LONG),
F0("getmypid", MAY_BE_FALSE | MAY_BE_LONG),
F0("getmyinode", MAY_BE_FALSE | MAY_BE_LONG),
F0("getlastmod", MAY_BE_FALSE | MAY_BE_LONG),
- F1("base64_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("base64_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("password_hash", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("password_get_info", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
- F0("password_needs_rehash", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("base64_decode", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("base64_encode", MAY_BE_STRING),
+ F1("password_hash", MAY_BE_NULL | MAY_BE_STRING),
+ F1("password_get_info", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F0("password_needs_rehash", MAY_BE_FALSE | MAY_BE_TRUE),
F0("password_verify", MAY_BE_FALSE | MAY_BE_TRUE),
F1("convert_uuencode", MAY_BE_FALSE | MAY_BE_STRING),
F1("convert_uudecode", MAY_BE_FALSE | MAY_BE_STRING),
- F0("abs", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_DOUBLE),
- F0("ceil", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("floor", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("round", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("sin", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("cos", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("tan", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("asin", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("acos", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("atan", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("atanh", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("atan2", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("sinh", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("cosh", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("tanh", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("asinh", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("acosh", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("expm1", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("log1p", MAY_BE_NULL | MAY_BE_DOUBLE),
+ F0("abs", MAY_BE_LONG | MAY_BE_DOUBLE),
+ F0("ceil", MAY_BE_DOUBLE),
+ F0("floor", MAY_BE_DOUBLE),
+ F0("round", MAY_BE_FALSE | MAY_BE_DOUBLE),
+ F0("sin", MAY_BE_DOUBLE),
+ F0("cos", MAY_BE_DOUBLE),
+ F0("tan", MAY_BE_DOUBLE),
+ F0("asin", MAY_BE_DOUBLE),
+ F0("acos", MAY_BE_DOUBLE),
+ F0("atan", MAY_BE_DOUBLE),
+ F0("atanh", MAY_BE_DOUBLE),
+ F0("atan2", MAY_BE_DOUBLE),
+ F0("sinh", MAY_BE_DOUBLE),
+ F0("cosh", MAY_BE_DOUBLE),
+ F0("tanh", MAY_BE_DOUBLE),
+ F0("asinh", MAY_BE_DOUBLE),
+ F0("acosh", MAY_BE_DOUBLE),
+ F0("expm1", MAY_BE_DOUBLE),
+ F0("log1p", MAY_BE_DOUBLE),
F0("pi", MAY_BE_DOUBLE),
- F0("is_finite", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_nan", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_infinite", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("pow", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_DOUBLE),
- F0("exp", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("log", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("log10", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("sqrt", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("hypot", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("deg2rad", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("rad2deg", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("bindec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_DOUBLE),
- F0("hexdec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_DOUBLE),
- F0("octdec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_DOUBLE),
- F1("decbin", MAY_BE_NULL | MAY_BE_STRING),
- F1("decoct", MAY_BE_NULL | MAY_BE_STRING),
- FC("dechex", zend_dechex_info),
- F1("base_convert", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("number_format", MAY_BE_NULL | MAY_BE_STRING),
- F0("fmod", MAY_BE_NULL | MAY_BE_DOUBLE),
+ F0("is_finite", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_nan", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_infinite", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pow", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_OBJECT),
+ F0("exp", MAY_BE_DOUBLE),
+ F0("log", MAY_BE_FALSE | MAY_BE_DOUBLE),
+ F0("log10", MAY_BE_DOUBLE),
+ F0("sqrt", MAY_BE_DOUBLE),
+ F0("hypot", MAY_BE_DOUBLE),
+ F0("deg2rad", MAY_BE_DOUBLE),
+ F0("rad2deg", MAY_BE_DOUBLE),
+ F0("bindec", MAY_BE_LONG | MAY_BE_DOUBLE),
+ F0("hexdec", MAY_BE_LONG | MAY_BE_DOUBLE),
+ F0("octdec", MAY_BE_LONG | MAY_BE_DOUBLE),
+ F1("decbin", MAY_BE_STRING),
+ F1("decoct", MAY_BE_STRING),
+ F1("dechex", MAY_BE_STRING),
+ F1("base_convert", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("number_format", MAY_BE_STRING),
+ F0("fmod", MAY_BE_DOUBLE),
#ifdef HAVE_INET_NTOP
F1("inet_ntop", MAY_BE_FALSE | MAY_BE_STRING),
#endif
#ifdef HAVE_INET_PTON
F1("inet_pton", MAY_BE_FALSE | MAY_BE_STRING),
#endif
- F0("ip2long", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F1("long2ip", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("ip2long", MAY_BE_FALSE | MAY_BE_LONG),
+ F1("long2ip", MAY_BE_FALSE | MAY_BE_STRING),
F1("getenv", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
#ifdef HAVE_PUTENV
- F0("putenv", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("putenv", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F1("getopt", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#ifdef HAVE_GETLOADAVG
F1("sys_getloadavg", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
#endif
#ifdef HAVE_GETTIMEOFDAY
- F1("microtime", MAY_BE_NULL | MAY_BE_DOUBLE | MAY_BE_STRING),
- F1("gettimeofday", MAY_BE_NULL | MAY_BE_DOUBLE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
+ F1("microtime", MAY_BE_DOUBLE | MAY_BE_STRING),
+ F1("gettimeofday", MAY_BE_DOUBLE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
#endif
#ifdef HAVE_GETRUSAGE
- F1("getrusage", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
+ F1("getrusage", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
#endif
#ifdef HAVE_GETTIMEOFDAY
- F1("uniqid", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("uniqid", MAY_BE_STRING),
#endif
- F1("quoted_printable_decode", MAY_BE_NULL | MAY_BE_STRING),
- F1("quoted_printable_encode", MAY_BE_NULL | MAY_BE_STRING),
- F1("convert_cyr_string", MAY_BE_NULL | MAY_BE_STRING),
- I1("get_current_user", MAY_BE_STRING),
- F0("set_time_limit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("header_register_callback", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("get_cfg_var", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
- I0("magic_quotes_runtime", MAY_BE_FALSE),
- I0("set_magic_quotes_runtime", MAY_BE_FALSE),
- I0("get_magic_quotes_gpc", MAY_BE_FALSE),
- I0("get_magic_quotes_runtime", MAY_BE_FALSE),
- F0("error_log", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- I1("error_get_last", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("quoted_printable_decode", MAY_BE_STRING),
+ F1("quoted_printable_encode", MAY_BE_STRING),
+ F1("convert_cyr_string", MAY_BE_STRING),
+ F1("get_current_user", MAY_BE_STRING),
+ F0("set_time_limit", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("header_register_callback", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("get_cfg_var", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F0("magic_quotes_runtime", MAY_BE_FALSE),
+ F0("set_magic_quotes_runtime", MAY_BE_FALSE),
+ F0("get_magic_quotes_gpc", MAY_BE_FALSE),
+ F0("get_magic_quotes_runtime", MAY_BE_FALSE),
+ F0("error_log", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("error_get_last", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
FN("call_user_func", UNKNOWN_INFO),
FN("call_user_func_array", UNKNOWN_INFO),
FN("call_user_method", UNKNOWN_INFO),
@@ -543,14 +414,14 @@ static const func_info_t func_infos[] = {
F1("highlight_file", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
F1("show_source", MAY_BE_FALSE | MAY_BE_STRING),
F1("highlight_string", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
- F1("php_strip_whitespace", MAY_BE_FALSE | MAY_BE_STRING),
- FN("ini_get", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("ini_get_all", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
- FN("ini_set", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("php_strip_whitespace", MAY_BE_STRING),
+ FN("ini_get", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("ini_get_all", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ FN("ini_set", MAY_BE_FALSE | MAY_BE_STRING),
F1("ini_alter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("ini_restore", MAY_BE_NULL),
- I1("get_include_path", MAY_BE_FALSE | MAY_BE_STRING),
- F1("set_include_path", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("get_include_path", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("set_include_path", MAY_BE_FALSE | MAY_BE_STRING),
F0("restore_include_path", MAY_BE_NULL),
F0("setcookie", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("setrawcookie", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
@@ -561,55 +432,55 @@ static const func_info_t func_infos[] = {
F0("http_response_code", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("connection_aborted", MAY_BE_LONG),
F0("connection_status", MAY_BE_LONG),
- F0("ignore_user_abort", MAY_BE_NULL | MAY_BE_LONG),
+ F0("ignore_user_abort", MAY_BE_LONG),
F1("parse_ini_file", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
F1("parse_ini_string", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#if ZEND_DEBUG
F1("config_get_hash", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#endif
- F0("is_uploaded_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("move_uploaded_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("gethostbyaddr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("gethostbyname", MAY_BE_NULL | MAY_BE_STRING),
- F1("gethostbynamel", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("is_uploaded_file", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("move_uploaded_file", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("gethostbyaddr", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("gethostbyname", MAY_BE_STRING),
+ F1("gethostbynamel", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
#ifdef HAVE_GETHOSTNAME
F1("gethostname", MAY_BE_FALSE | MAY_BE_STRING),
#endif
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
- F0("dns_check_record", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("checkdnsrr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("dns_check_record", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("checkdnsrr", MAY_BE_FALSE | MAY_BE_TRUE),
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
- F0("dns_get_mx", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("getmxrr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("dns_get_record", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
+ F0("dns_get_mx", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("getmxrr", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("dns_get_record", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
# endif
#endif
- F0("intval", MAY_BE_NULL | MAY_BE_LONG),
- F0("floatval", MAY_BE_NULL | MAY_BE_DOUBLE),
- F0("doubleval", MAY_BE_NULL | MAY_BE_DOUBLE),
- FN("strval", MAY_BE_NULL | MAY_BE_STRING),
- F0("boolval", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- FN("gettype", MAY_BE_NULL | MAY_BE_STRING),
- F0("settype", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- FC("is_null", zend_is_type_info),
+ F0("intval", MAY_BE_LONG),
+ F0("floatval", MAY_BE_DOUBLE),
+ F0("doubleval", MAY_BE_DOUBLE),
+ FN("strval", MAY_BE_STRING),
+ F0("boolval", MAY_BE_FALSE | MAY_BE_TRUE),
+ FN("gettype", MAY_BE_STRING),
+ F0("settype", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_null", MAY_BE_FALSE | MAY_BE_TRUE),
F0("is_resource", MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline with support for closed resources
- FC("is_bool", zend_is_type_info),
- FC("is_long", zend_is_type_info),
- FC("is_float", zend_is_type_info),
- FC("is_int", zend_is_type_info),
- FC("is_integer", zend_is_type_info),
- FC("is_double", zend_is_type_info),
- FC("is_real", zend_is_type_info),
- F0("is_numeric", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- FC("is_string", zend_is_type_info),
- FC("is_array", zend_is_type_info),
+ F0("is_bool", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_long", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_float", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_int", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_integer", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_double", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_real", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_numeric", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_string", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_array", MAY_BE_FALSE | MAY_BE_TRUE),
F0("is_object", MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline with support for incomplete class
- F0("is_scalar", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_callable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_countable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_iterable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_scalar", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_callable", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_countable", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_iterable", MAY_BE_FALSE | MAY_BE_TRUE),
F0("pclose", MAY_BE_FALSE | MAY_BE_LONG),
- F1("popen", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("popen", MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("readfile", MAY_BE_FALSE | MAY_BE_LONG),
F0("rewind", MAY_BE_FALSE | MAY_BE_TRUE),
F0("rmdir", MAY_BE_FALSE | MAY_BE_TRUE),
@@ -618,7 +489,6 @@ static const func_info_t func_infos[] = {
F0("feof", MAY_BE_FALSE | MAY_BE_TRUE),
F1("fgetc", MAY_BE_FALSE | MAY_BE_STRING),
F1("fgets", MAY_BE_FALSE | MAY_BE_STRING),
- F1("fgetss", MAY_BE_FALSE | MAY_BE_STRING),
F1("fread", MAY_BE_FALSE | MAY_BE_STRING),
F1("fopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("fpassthru", MAY_BE_FALSE | MAY_BE_LONG),
@@ -631,13 +501,13 @@ static const func_info_t func_infos[] = {
F0("fputs", MAY_BE_FALSE | MAY_BE_LONG),
F0("mkdir", MAY_BE_FALSE | MAY_BE_TRUE),
F0("rename", MAY_BE_FALSE | MAY_BE_TRUE),
- F0("copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("tempnam", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("copy", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("tempnam", MAY_BE_FALSE | MAY_BE_STRING),
F1("tmpfile", MAY_BE_FALSE | MAY_BE_RESOURCE),
- F1("file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("file_get_contents", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("file_put_contents", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("stream_select", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F1("file", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("file_get_contents", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("file_put_contents", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("stream_select", MAY_BE_FALSE | MAY_BE_LONG),
F1("stream_context_create", MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("stream_context_set_params", MAY_BE_FALSE | MAY_BE_TRUE),
F1("stream_context_get_params", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
@@ -665,16 +535,16 @@ static const func_info_t func_infos[] = {
F1("stream_get_contents", MAY_BE_FALSE | MAY_BE_STRING),
F0("stream_supports_lock", MAY_BE_FALSE | MAY_BE_TRUE),
F1("fgetcsv", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
- F0("fputcsv", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("flock", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("get_meta_tags", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
+ F0("fputcsv", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("flock", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("get_meta_tags", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
F0("stream_set_read_buffer", MAY_BE_FALSE | MAY_BE_LONG),
F0("stream_set_write_buffer", MAY_BE_FALSE | MAY_BE_LONG),
F0("set_file_buffer", MAY_BE_FALSE | MAY_BE_LONG),
F0("stream_set_chunk_size", MAY_BE_FALSE | MAY_BE_LONG),
- F0("stream_set_blocking", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("socket_set_blocking", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("stream_get_meta_data", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F0("stream_set_blocking", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("socket_set_blocking", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("stream_get_meta_data", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
F1("stream_get_line", MAY_BE_FALSE | MAY_BE_STRING),
F0("stream_wrapper_register", MAY_BE_FALSE | MAY_BE_TRUE),
F0("stream_register_wrapper", MAY_BE_FALSE | MAY_BE_TRUE),
@@ -682,27 +552,27 @@ static const func_info_t func_infos[] = {
F0("stream_wrapper_restore", MAY_BE_FALSE | MAY_BE_TRUE),
F1("stream_get_wrappers", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("stream_get_transports", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("stream_resolve_include_path", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("stream_resolve_include_path", MAY_BE_FALSE | MAY_BE_STRING),
F0("stream_is_local", MAY_BE_FALSE | MAY_BE_TRUE),
- F1("get_headers", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F1("get_headers", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
- F0("stream_set_timeout", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("socket_set_timeout", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("stream_set_timeout", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("socket_set_timeout", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
- F1("socket_get_status", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F1("socket_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
#if HAVE_REALPATH || defined(ZTS)
- F1("realpath", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("realpath", MAY_BE_FALSE | MAY_BE_STRING),
#endif
#ifdef HAVE_FNMATCH
- F0("fnmatch", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("fnmatch", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F1("fsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
FN("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("pack", MAY_BE_FALSE | MAY_BE_STRING),
- F1("unpack", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ F1("unpack", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("get_browser", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_OBJECT | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
- F1("crypt", MAY_BE_NULL | MAY_BE_STRING),
- FN("opendir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("crypt", MAY_BE_STRING),
+ FN("opendir", MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("closedir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("chdir", MAY_BE_FALSE | MAY_BE_TRUE),
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
@@ -710,86 +580,86 @@ static const func_info_t func_infos[] = {
#endif
F1("getcwd", MAY_BE_FALSE | MAY_BE_STRING),
F0("rewinddir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("readdir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("dir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
- F1("scandir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("readdir", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("dir", MAY_BE_FALSE | MAY_BE_OBJECT),
+ F1("scandir", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
#ifdef HAVE_GLOB
- F1("glob", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("glob", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
#endif
- F0("fileatime", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("filectime", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("filegroup", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("fileinode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("filemtime", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("fileowner", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("fileperms", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("filesize", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F1("filetype", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("file_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_writable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_writeable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_readable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_executable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_dir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("is_link", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("stat", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("lstat", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
- F0("chown", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("chgrp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("fileatime", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("filectime", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("filegroup", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("fileinode", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("filemtime", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("fileowner", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("fileperms", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("filesize", MAY_BE_FALSE | MAY_BE_LONG),
+ F1("filetype", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("file_exists", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_writable", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_writeable", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_readable", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_executable", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_file", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_dir", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("is_link", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("stat", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("lstat", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("chown", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("chgrp", MAY_BE_FALSE | MAY_BE_TRUE),
#if HAVE_LCHOWN
- F0("lchown", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("lchown", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
#if HAVE_LCHOWN
- F0("lchgrp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("lchgrp", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
- F0("chmod", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("chmod", MAY_BE_FALSE | MAY_BE_TRUE),
#if HAVE_UTIME
- F0("touch", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("touch", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F0("clearstatcache", MAY_BE_NULL),
- F0("disk_total_space", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("disk_free_space", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("diskfreespace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- I0("realpath_cache_size", MAY_BE_LONG),
- I1("realpath_cache_get", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
- F0("mail", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ezmlm_hash", MAY_BE_NULL | MAY_BE_LONG),
+ F0("disk_total_space", MAY_BE_FALSE | MAY_BE_DOUBLE),
+ F0("disk_free_space", MAY_BE_FALSE | MAY_BE_DOUBLE),
+ F0("diskfreespace", MAY_BE_FALSE | MAY_BE_DOUBLE),
+ F0("realpath_cache_size", MAY_BE_LONG),
+ F1("realpath_cache_get", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F0("mail", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ezmlm_hash", MAY_BE_LONG),
#ifdef HAVE_SYSLOG_H
- F0("openlog", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("syslog", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("openlog", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("syslog", MAY_BE_FALSE | MAY_BE_TRUE),
F0("closelog", MAY_BE_TRUE),
#endif
F0("lcg_value", MAY_BE_DOUBLE),
- F1("metaphone", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("ob_start", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ob_flush", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ob_clean", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ob_end_flush", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ob_end_clean", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("ob_get_flush", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("ob_get_clean", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("ob_get_length", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("ob_get_level", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F1("ob_get_status", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
- FN("ob_get_contents", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("metaphone", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("ob_start", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ob_flush", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ob_clean", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ob_end_flush", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ob_end_clean", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("ob_get_flush", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("ob_get_clean", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("ob_get_length", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("ob_get_level", MAY_BE_LONG),
+ F1("ob_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ FN("ob_get_contents", MAY_BE_FALSE | MAY_BE_STRING),
F0("ob_implicit_flush", MAY_BE_NULL),
- F1("ob_list_handlers", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("ob_list_handlers", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("ksort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("krsort", MAY_BE_FALSE | MAY_BE_TRUE),
- F0("natsort", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("natcasesort", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("natsort", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("natcasesort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("asort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("arsort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("sort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("rsort", MAY_BE_FALSE | MAY_BE_TRUE),
- F0("usort", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("uasort", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("uksort", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("usort", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("uasort", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("uksort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("shuffle", MAY_BE_FALSE | MAY_BE_TRUE),
- F0("array_walk", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("array_walk_recursive", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("count", MAY_BE_NULL | MAY_BE_LONG),
+ F0("array_walk", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("array_walk_recursive", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("count", MAY_BE_LONG),
FN("end", UNKNOWN_INFO),
FN("prev", UNKNOWN_INFO),
FN("next", UNKNOWN_INFO),
@@ -798,79 +668,79 @@ static const func_info_t func_infos[] = {
FN("key", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_STRING),
FN("min", UNKNOWN_INFO),
FN("max", UNKNOWN_INFO),
- F0("in_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("in_array", MAY_BE_FALSE | MAY_BE_TRUE),
FN("array_search", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
F0("extract", MAY_BE_NULL | MAY_BE_LONG),
F1("compact", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_fill", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
- F1("array_fill_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_fill", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
+ F1("array_fill_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
FC("range", zend_range_info),
- F0("array_multisort", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("array_push", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("array_multisort", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("array_push", MAY_BE_FALSE | MAY_BE_LONG),
FN("array_pop", UNKNOWN_INFO),
FN("array_shift", UNKNOWN_INFO),
- F0("array_unshift", MAY_BE_NULL | MAY_BE_LONG),
- F1("array_splice", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_slice", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- FN("array_merge", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_merge_recursive", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_replace", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_replace_recursive", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- FN("array_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
- FN("array_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_count_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG),
- F1("array_column", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_reverse", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F0("array_unshift", MAY_BE_LONG),
+ F1("array_splice", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_slice", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ FN("array_merge", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_merge_recursive", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_replace", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_replace_recursive", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ FN("array_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ FN("array_values", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_count_values", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG),
+ F1("array_column", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_reverse", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_reduce", UNKNOWN_INFO),
- FN("array_pad", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_flip", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("array_change_key_case", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ FN("array_pad", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_flip", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("array_change_key_case", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_rand", UNKNOWN_INFO),
- FN("array_unique", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_intersect", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_intersect_key", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_intersect_ukey", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_uintersect", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_intersect_assoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_uintersect_assoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_intersect_uassoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_uintersect_uassoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- FN("array_diff", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_diff_key", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_diff_ukey", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_udiff", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_diff_assoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_udiff_assoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_diff_uassoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_udiff_uassoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F0("array_sum", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_DOUBLE),
- F0("array_product", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_DOUBLE),
- F1("array_filter", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- FN("array_map", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ FN("array_unique", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_intersect", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_intersect_key", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_intersect_ukey", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_uintersect", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_intersect_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_uintersect_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_intersect_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_uintersect_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ FN("array_diff", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_diff_key", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_diff_ukey", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_udiff", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_diff_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_udiff_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_diff_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F1("array_udiff_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F0("array_sum", MAY_BE_LONG | MAY_BE_DOUBLE),
+ F0("array_product", MAY_BE_LONG | MAY_BE_DOUBLE),
+ F1("array_filter", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ FN("array_map", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_chunk", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F1("array_combine", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
- F0("array_key_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("array_combine", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
+ F0("array_key_exists", MAY_BE_FALSE | MAY_BE_TRUE),
FN("array_key_first", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_STRING),
FN("array_key_last", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_STRING),
F1("pos", UNKNOWN_INFO),
- F0("sizeof", MAY_BE_NULL | MAY_BE_LONG),
- F0("key_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("assert", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("sizeof", MAY_BE_LONG),
+ F0("key_exists", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("assert", MAY_BE_FALSE | MAY_BE_TRUE),
F1("assert_options", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT),
F0("version_compare", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG),
#if HAVE_FTOK
- F0("ftok", MAY_BE_NULL | MAY_BE_LONG),
+ F0("ftok", MAY_BE_LONG),
#endif
- F1("str_rot13", MAY_BE_NULL | MAY_BE_STRING),
- I1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("str_rot13", MAY_BE_STRING),
+ F1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("stream_filter_register", MAY_BE_FALSE | MAY_BE_TRUE),
- F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
+ F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_OBJECT),
F1("stream_bucket_prepend", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("stream_bucket_append", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("stream_bucket_new", MAY_BE_FALSE | MAY_BE_OBJECT),
- F0("output_add_rewrite_var", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("output_add_rewrite_var", MAY_BE_FALSE | MAY_BE_TRUE),
F0("output_reset_rewrite_vars", MAY_BE_FALSE),
- I1("sys_get_temp_dir", MAY_BE_STRING),
+ F1("sys_get_temp_dir", MAY_BE_STRING),
/* ext/date */
F0("strtotime", MAY_BE_FALSE | MAY_BE_LONG),
@@ -936,8 +806,8 @@ static const func_info_t func_infos[] = {
/* ext/mysqli */
F1("mysqli_connect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F0("mysqli_close", MAY_BE_NULL | MAY_BE_TRUE),
- I1("mysqli_connect_error", MAY_BE_NULL | MAY_BE_STRING),
- I0("mysqli_connect_errno", MAY_BE_LONG),
+ F1("mysqli_connect_error", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_connect_errno", MAY_BE_LONG),
F1("mysqli_get_client_stats", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
F1("mysqli_error_list", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
F1("mysqli_get_links_stats", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
@@ -981,8 +851,8 @@ static const func_info_t func_infos[] = {
F0("mysqli_field_count", MAY_BE_NULL | MAY_BE_LONG),
F0("mysqli_field_seek", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("mysqli_field_tell", MAY_BE_NULL | MAY_BE_LONG),
- I1("mysqli_get_client_info", MAY_BE_STRING),
- I0("mysqli_get_client_version", MAY_BE_LONG),
+ F1("mysqli_get_client_info", MAY_BE_STRING),
+ F0("mysqli_get_client_version", MAY_BE_LONG),
F1("mysqli_get_host_info", MAY_BE_NULL | MAY_BE_STRING),
F0("mysqli_get_proto_info", MAY_BE_NULL | MAY_BE_LONG),
F1("mysqli_get_server_info", MAY_BE_NULL | MAY_BE_STRING),
@@ -1030,7 +900,7 @@ static const func_info_t func_infos[] = {
F1("mysqli_stmt_sqlstate", MAY_BE_NULL | MAY_BE_STRING),
F1("mysqli_store_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F0("mysqli_thread_id", MAY_BE_NULL | MAY_BE_LONG),
- I0("mysqli_thread_safe", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_thread_safe", MAY_BE_FALSE | MAY_BE_TRUE),
F1("mysqli_use_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F0("mysqli_warning_count", MAY_BE_NULL | MAY_BE_LONG),
@@ -1060,7 +930,7 @@ static const func_info_t func_infos[] = {
F1("curl_multi_info_read", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_RESOURCE),
F0("curl_multi_close", MAY_BE_NULL | MAY_BE_FALSE),
F0("curl_multi_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- I1("curl_share_init", MAY_BE_RESOURCE),
+ F1("curl_share_init", MAY_BE_RESOURCE),
F0("curl_share_close", MAY_BE_NULL),
F0("curl_share_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("curl_file_create", MAY_BE_OBJECT),
@@ -1094,7 +964,7 @@ static const func_info_t func_infos[] = {
F1("mb_strimwidth", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("mb_convert_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mb_detect_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- I1("mb_list_encodings", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("mb_list_encodings", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("mb_encoding_aliases", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("mb_convert_kana", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("mb_encode_mimeheader", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
@@ -1123,21 +993,6 @@ static const func_info_t func_infos[] = {
F0("mb_ereg_search_getpos", MAY_BE_LONG),
F0("mb_ereg_search_setpos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("mbregex_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("mbereg", MAY_BE_FALSE | MAY_BE_LONG),
- F0("mberegi", MAY_BE_FALSE | MAY_BE_LONG),
- F1("mbereg_replace", MAY_BE_FALSE | MAY_BE_STRING),
- F1("mberegi_replace", MAY_BE_FALSE | MAY_BE_STRING),
- F1("mbsplit", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F0("mbereg_match", MAY_BE_FALSE | MAY_BE_TRUE),
- F0("mbereg_search", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("mbereg_search_pos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
- F1("mbereg_search_regs", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_STRING),
- F0("mbereg_search_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("mbereg_search_getregs", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_STRING),
- F0("mbereg_search_getpos", MAY_BE_LONG),
- F0("mbereg_search_setpos", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
-
/* ext/iconv */
F1("iconv", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("iconv_get_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
@@ -1153,12 +1008,12 @@ static const func_info_t func_infos[] = {
/* ext/json */
F1("json_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("json_decode", MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
- I0("json_last_error", MAY_BE_LONG),
- I1("json_last_error_msg", MAY_BE_STRING),
+ F0("json_last_error", MAY_BE_LONG),
+ F1("json_last_error_msg", MAY_BE_STRING),
/* ext/xml */
- FN("xml_parser_create", MAY_BE_FALSE | MAY_BE_RESOURCE),
- FN("xml_parser_create_ns", MAY_BE_FALSE | MAY_BE_RESOURCE),
+ FN("xml_parser_create", MAY_BE_FALSE | MAY_BE_OBJECT),
+ FN("xml_parser_create_ns", MAY_BE_FALSE | MAY_BE_OBJECT),
F0("xml_set_object", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("xml_set_element_handler", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("xml_set_character_data_handler", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
@@ -1179,8 +1034,8 @@ static const func_info_t func_infos[] = {
F0("xml_parser_free", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("xml_parser_set_option", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("xml_parser_get_option", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
- F1("utf8_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("utf8_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("utf8_encode", MAY_BE_STRING),
+ F1("utf8_decode", MAY_BE_STRING),
/* ext/zlib */
F0("readgzfile", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
@@ -1189,7 +1044,6 @@ static const func_info_t func_infos[] = {
F0("gzeof", MAY_BE_FALSE | MAY_BE_TRUE),
F1("gzgetc", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzgets", MAY_BE_FALSE | MAY_BE_STRING),
- F1("gzgetss", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzread", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzopen", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("gzpassthru", MAY_BE_FALSE | MAY_BE_LONG),
@@ -1206,7 +1060,7 @@ static const func_info_t func_infos[] = {
F1("gzdecode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- I1("zlib_get_coding_type", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("zlib_get_coding_type", MAY_BE_FALSE | MAY_BE_STRING),
F1("ob_gzhandler", MAY_BE_FALSE | MAY_BE_STRING),
/* ext/hash */
@@ -1219,7 +1073,7 @@ static const func_info_t func_infos[] = {
F1("hash_hkdf", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F0("hash_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("hash_update_stream", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("hash_update_stream", MAY_BE_NULL | MAY_BE_LONG),
F0("hash_update_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("hash_final", MAY_BE_NULL | MAY_BE_STRING),
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
@@ -1228,7 +1082,7 @@ static const func_info_t func_infos[] = {
F1("mhash_keygen_s2k", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("mhash_get_block_size", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F1("mhash_get_hash_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- I0("mhash_count", MAY_BE_LONG),
+ F0("mhash_count", MAY_BE_LONG),
F1("mhash", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
/* ext/sodium */
@@ -1311,7 +1165,7 @@ static const func_info_t func_infos[] = {
/* ext/session */
F0("session_set_cookie_params", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- I1("session_get_cookie_params", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F1("session_get_cookie_params", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
F1("session_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("session_module_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("session_set_save_handler", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
@@ -1321,17 +1175,17 @@ static const func_info_t func_infos[] = {
F1("session_create_id", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("session_cache_limiter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("session_cache_expire", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- I1("session_encode", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("session_encode", MAY_BE_FALSE | MAY_BE_STRING),
F0("session_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("session_start", MAY_BE_FALSE | MAY_BE_TRUE),
- I0("session_destroy", MAY_BE_FALSE | MAY_BE_TRUE),
- I0("session_unset", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_destroy", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_unset", MAY_BE_FALSE | MAY_BE_TRUE),
F0("session_gc", MAY_BE_FALSE | MAY_BE_LONG),
F0("session_write_close", MAY_BE_FALSE | MAY_BE_TRUE),
F0("session_abort", MAY_BE_FALSE | MAY_BE_TRUE),
F0("session_reset", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("session_status", MAY_BE_NULL | MAY_BE_LONG),
- I0("session_register_shutdown", MAY_BE_NULL),
+ F0("session_register_shutdown", MAY_BE_NULL),
/* ext/pgsql */
F1("pg_connect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
@@ -1423,16 +1277,16 @@ static const func_info_t func_infos[] = {
F1("pg_select", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
/* ext/bcmath */
- F1("bcadd", MAY_BE_NULL | MAY_BE_STRING),
- F1("bcsub", MAY_BE_NULL | MAY_BE_STRING),
- F1("bcmul", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcadd", MAY_BE_STRING),
+ F1("bcsub", MAY_BE_STRING),
+ F1("bcmul", MAY_BE_STRING),
F1("bcdiv", MAY_BE_NULL | MAY_BE_STRING),
F1("bcmod", MAY_BE_NULL | MAY_BE_STRING),
F1("bcpowmod", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("bcpow", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcpow", MAY_BE_STRING),
F1("bcsqrt", MAY_BE_NULL | MAY_BE_STRING),
- F0("bccomp", MAY_BE_NULL | MAY_BE_LONG),
- F0("bcscale", MAY_BE_NULL | MAY_BE_LONG),
+ F0("bccomp", MAY_BE_LONG),
+ F0("bcscale", MAY_BE_LONG),
/* ext/exif */
F1("exif_tagname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
@@ -1446,7 +1300,7 @@ static const func_info_t func_infos[] = {
FN("filter_var", UNKNOWN_INFO),
F1("filter_input_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("filter_var_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
- I1("filter_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("filter_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("filter_id", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
/* ext/gettext */
@@ -1467,17 +1321,17 @@ static const func_info_t func_infos[] = {
#endif
/* ext/ctype */
- F0("ctype_alnum", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_alpha", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_cntrl", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_digit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_lower", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_graph", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_print", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_punct", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_space", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_upper", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("ctype_xdigit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_alnum", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_alpha", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_cntrl", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_digit", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_lower", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_graph", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_print", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_punct", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_space", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_upper", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_xdigit", MAY_BE_FALSE | MAY_BE_TRUE),
/* ext/fileinfo */
F1("finfo_open", MAY_BE_FALSE | MAY_BE_RESOURCE),
@@ -1515,18 +1369,16 @@ static const func_info_t func_infos[] = {
F0("imagesettile", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("imagesetbrush", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("imagecreate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
- I0("imagetypes", MAY_BE_LONG),
+ F0("imagetypes", MAY_BE_LONG),
F1("imagecreatefromstring", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("imagecreatefromgif", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
#ifdef HAVE_GD_JPG
F1("imagecreatefromjpeg", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("imagejpeg", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("jpeg2wbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
#endif
#ifdef HAVE_GD_PNG
F1("imagecreatefrompng", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("imagepng", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("png2wbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
#endif
#ifdef HAVE_GD_WEBP
F1("imagecreatefromwebp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
@@ -1594,7 +1446,6 @@ static const func_info_t func_infos[] = {
F1("imagefttext", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imagettfbbox", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imagettftext", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
- F0("image2wbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("imagefilter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("imageconvolution", MAY_BE_FALSE | MAY_BE_TRUE),
F0("imageflip", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
@@ -1631,31 +1482,33 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
if (callee_func->type == ZEND_INTERNAL_FUNCTION) {
zval *zv;
- func_info_t *info;
+ zend_string *lcname = Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array, call_info->caller_init_opline, call_info->caller_init_opline->op2, ssa->rt_constants));
- zv = zend_hash_find_ex(&func_info, Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array, call_info->caller_init_opline, call_info->caller_init_opline->op2, ssa->rt_constants)), 1);
+ zv = zend_hash_find_ex(&func_info, lcname, 1);
if (zv) {
- info = Z_PTR_P(zv);
+ func_info_t *info = Z_PTR_P(zv);
if (UNEXPECTED(zend_optimizer_is_disabled_func(info->name, info->name_len))) {
ret = MAY_BE_NULL;
} else if (info->info_func) {
ret = info->info_func(call_info, ssa);
- } else if (/*callee_func->common.arg_info && */
- callee_func->common.num_args == 0 &&
- callee_func->common.required_num_args == 0 &&
- !(callee_func->common.fn_flags & ZEND_ACC_VARIADIC)) {
- if (call_info->num_args == 0) {
- ret = info->info;
- } else {
- ret = FUNC_MAY_WARN | MAY_BE_NULL;
- }
} else {
ret = info->info;
}
-#if 0
+ return ret;
+ }
+
+ if (callee_func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
+ zend_class_entry *ce; // TODO: Use the CE.
+ ret = zend_fetch_arg_info_type(NULL, callee_func->common.arg_info - 1, &ce);
} else {
+#if 0
fprintf(stderr, "Unknown internal function '%s'\n", func->common.function_name);
#endif
+ ret = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF
+ | MAY_BE_RC1 | MAY_BE_RCN;
+ }
+ if (callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
+ ret |= MAY_BE_REF;
}
} else {
// FIXME: the order of functions matters!!!
@@ -1663,18 +1516,14 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
if (info) {
ret = info->return_info.type;
}
- }
- if (!ret) {
- ret = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
- if (callee_func->type == ZEND_INTERNAL_FUNCTION) {
- ret |= FUNC_MAY_WARN;
- }
- if (callee_func->common.fn_flags & ZEND_ACC_GENERATOR) {
- ret = MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_OBJECT;
- } else if (callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
- ret |= MAY_BE_REF;
- } else {
- ret |= MAY_BE_RC1 | MAY_BE_RCN;
+ if (!ret) {
+ ret = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF
+ | MAY_BE_RC1 | MAY_BE_RCN;
+ /* For generators RETURN_REFERENCE refers to the yielded values. */
+ if ((callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
+ && !(callee_func->common.fn_flags & ZEND_ACC_GENERATOR)) {
+ ret |= MAY_BE_REF;
+ }
}
}
return ret;
diff --git a/ext/opcache/Optimizer/zend_func_info.h b/ext/opcache/Optimizer/zend_func_info.h
index 7eeb363da5..0f4fcea092 100644
--- a/ext/opcache/Optimizer/zend_func_info.h
+++ b/ext/opcache/Optimizer/zend_func_info.h
@@ -34,11 +34,6 @@
#define ZEND_FUNC_HAS_EXTENDED_FCALL (1<<10)
#define ZEND_FUNC_HAS_EXTENDED_STMT (1<<11)
-/* The following flags are valid only for return values of internal functions
- * returned by zend_get_func_info()
- */
-#define FUNC_MAY_WARN (1<<30)
-
typedef struct _zend_func_info zend_func_info;
typedef struct _zend_call_info zend_call_info;
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index f89b133b92..c16652b8b6 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -1419,18 +1419,22 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
return 1;
} else if (op_array->arg_info &&
opline->op1.num <= op_array->num_args) {
- if (ZEND_TYPE_CODE(op_array->arg_info[opline->op1.num-1].type) == IS_LONG) {
- tmp->underflow = 0;
- tmp->min = ZEND_LONG_MIN;
- tmp->max = ZEND_LONG_MAX;
- tmp->overflow = 0;
- return 1;
- } else if (ZEND_TYPE_CODE(op_array->arg_info[opline->op1.num-1].type) == _IS_BOOL) {
- tmp->underflow = 0;
- tmp->min = 0;
- tmp->max = 1;
- tmp->overflow = 0;
- return 1;
+ zend_type type = op_array->arg_info[opline->op1.num-1].type;
+ if (ZEND_TYPE_IS_MASK(type)) {
+ uint32_t mask = ZEND_TYPE_MASK(ZEND_TYPE_WITHOUT_NULL(type));
+ if (mask == MAY_BE_LONG) {
+ tmp->underflow = 0;
+ tmp->min = ZEND_LONG_MIN;
+ tmp->max = ZEND_LONG_MAX;
+ tmp->overflow = 0;
+ return 1;
+ } else if (mask == (MAY_BE_FALSE|MAY_BE_TRUE)) {
+ tmp->underflow = 0;
+ tmp->min = 0;
+ tmp->max = 1;
+ tmp->overflow = 0;
+ return 1;
+ }
}
}
}
@@ -1833,9 +1837,7 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
/* }}} */
static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) {
- if (alias == PHP_ERRORMSG_ALIAS) {
- return MAY_BE_STRING | MAY_BE_RC1 | MAY_BE_RCN;
- } else if (alias == HTTP_RESPONSE_HEADER_ALIAS) {
+ if (alias == HTTP_RESPONSE_HEADER_ALIAS) {
return MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_RC1 | MAY_BE_RCN;
} else {
return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
@@ -2063,16 +2065,10 @@ uint32_t zend_array_element_type(uint32_t t1, int write, int insert)
}
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
tmp |= MAY_BE_NULL;
- if (t1 & MAY_BE_ERROR) {
- if (write) {
- tmp |= MAY_BE_ERROR;
- }
- }
}
if (t1 & (MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_RESOURCE)) {
- tmp |= MAY_BE_NULL;
- if (write) {
- tmp |= MAY_BE_ERROR;
+ if (!write) {
+ tmp |= MAY_BE_NULL;
}
}
return tmp;
@@ -2234,25 +2230,26 @@ static inline zend_class_entry *get_class_entry(const zend_script *script, zend_
return NULL;
}
-static uint32_t zend_convert_type_code_to_may_be(zend_uchar type_code) {
- switch (type_code) {
- case IS_VOID:
- return MAY_BE_NULL;
- case IS_CALLABLE:
- return MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
- case IS_ITERABLE:
- return MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
- case IS_ARRAY:
- return MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
- case _IS_BOOL:
- return MAY_BE_TRUE|MAY_BE_FALSE;
- default:
- ZEND_ASSERT(type_code < IS_REFERENCE);
- return 1 << type_code;
+static uint32_t zend_convert_type_declaration_mask(uint32_t type_mask) {
+ if (type_mask & MAY_BE_VOID) {
+ type_mask &= ~MAY_BE_VOID;
+ type_mask |= MAY_BE_NULL;
+ }
+ if (type_mask & MAY_BE_CALLABLE) {
+ type_mask &= ~MAY_BE_CALLABLE;
+ type_mask |= MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
+ }
+ if (type_mask & MAY_BE_ITERABLE) {
+ type_mask &= ~MAY_BE_ITERABLE;
+ type_mask |= MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
+ }
+ if (type_mask & MAY_BE_ARRAY) {
+ type_mask |= MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
}
+ return type_mask;
}
-static uint32_t zend_fetch_arg_info(const zend_script *script, zend_arg_info *arg_info, zend_class_entry **pce)
+uint32_t zend_fetch_arg_info_type(const zend_script *script, zend_arg_info *arg_info, zend_class_entry **pce)
{
uint32_t tmp = 0;
@@ -2263,14 +2260,17 @@ static uint32_t zend_fetch_arg_info(const zend_script *script, zend_arg_info *ar
tmp |= MAY_BE_OBJECT;
*pce = get_class_entry(script, lcname);
zend_string_release_ex(lcname, 0);
- } else if (ZEND_TYPE_IS_CODE(arg_info->type)) {
- tmp |= zend_convert_type_code_to_may_be(ZEND_TYPE_CODE(arg_info->type));
+ } else if (ZEND_TYPE_IS_MASK(arg_info->type)) {
+ tmp |= zend_convert_type_declaration_mask(ZEND_TYPE_MASK(arg_info->type));
} else {
tmp |= MAY_BE_ANY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
}
if (ZEND_TYPE_ALLOW_NULL(arg_info->type)) {
tmp |= MAY_BE_NULL;
}
+ if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
+ tmp |= MAY_BE_RC1 | MAY_BE_RCN;
+ }
return tmp;
}
@@ -2365,7 +2365,7 @@ static uint32_t zend_fetch_prop_type(const zend_script *script, zend_property_in
if (prop_info && ZEND_TYPE_IS_SET(prop_info->type)) {
uint32_t type = ZEND_TYPE_IS_CLASS(prop_info->type)
? MAY_BE_OBJECT
- : zend_convert_type_code_to_may_be(ZEND_TYPE_CODE(prop_info->type));
+ : zend_convert_type_declaration_mask(ZEND_TYPE_MASK(prop_info->type));
if (ZEND_TYPE_ALLOW_NULL(prop_info->type)) {
type |= MAY_BE_NULL;
@@ -2419,8 +2419,8 @@ static int zend_update_type_info(const zend_op_array *op_array,
/* If one of the operands cannot have any type, this means the operand derives from
* unreachable code. Propagate the empty result early, so that that the following
* code may assume that operands have at least one type. */
- if (!(t1 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_CLASS|MAY_BE_ERROR))
- || !(t2 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_CLASS|MAY_BE_ERROR))) {
+ if (!(t1 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_CLASS))
+ || !(t2 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_CLASS))) {
tmp = 0;
if (ssa_ops[i].result_def >= 0) {
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
@@ -2711,9 +2711,6 @@ static int zend_update_type_info(const zend_op_array *op_array,
tmp |= MAY_BE_LONG;
}
} else {
- if (t1 & MAY_BE_ERROR) {
- tmp |= MAY_BE_NULL;
- }
if (t1 & (MAY_BE_UNDEF | MAY_BE_NULL)) {
if (opline->opcode == ZEND_PRE_INC) {
tmp |= MAY_BE_LONG;
@@ -2746,7 +2743,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
if (t1 & (MAY_BE_RC1|MAY_BE_RCN)) {
tmp |= MAY_BE_RC1|MAY_BE_RCN;
}
- tmp |= t1 & ~(MAY_BE_UNDEF|MAY_BE_ERROR|MAY_BE_REF|MAY_BE_RCN);
+ tmp |= t1 & ~(MAY_BE_UNDEF|MAY_BE_REF|MAY_BE_RCN);
if (t1 & MAY_BE_UNDEF) {
tmp |= MAY_BE_NULL;
}
@@ -2773,9 +2770,6 @@ static int zend_update_type_info(const zend_op_array *op_array,
tmp |= MAY_BE_LONG;
}
} else {
- if (t1 & MAY_BE_ERROR) {
- tmp |= MAY_BE_NULL;
- }
if (t1 & (MAY_BE_UNDEF | MAY_BE_NULL)) {
if (opline->opcode == ZEND_POST_INC) {
tmp |= MAY_BE_LONG;
@@ -2953,7 +2947,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
if (opline->op2_type == IS_VAR && opline->extended_value == ZEND_RETURNS_FUNCTION) {
tmp = (MAY_BE_REF | MAY_BE_RCN | MAY_BE_RC1 | t2) & ~MAY_BE_UNDEF;
} else {
- tmp = (MAY_BE_REF | t2) & ~(MAY_BE_UNDEF|MAY_BE_ERROR|MAY_BE_RC1|MAY_BE_RCN);
+ tmp = (MAY_BE_REF | t2) & ~(MAY_BE_UNDEF|MAY_BE_RC1|MAY_BE_RCN);
}
if (t2 & MAY_BE_UNDEF) {
tmp |= MAY_BE_NULL;
@@ -2981,7 +2975,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
if ((opline+1)->op1_type == IS_VAR && (opline->extended_value & ZEND_RETURNS_FUNCTION)) {
tmp = (MAY_BE_REF | MAY_BE_RCN | MAY_BE_RC1 | t2) & ~MAY_BE_UNDEF;
} else {
- tmp = (MAY_BE_REF | t2) & ~(MAY_BE_UNDEF|MAY_BE_ERROR|MAY_BE_RC1|MAY_BE_RCN);
+ tmp = (MAY_BE_REF | t2) & ~(MAY_BE_UNDEF|MAY_BE_RC1|MAY_BE_RCN);
}
if (t2 & MAY_BE_UNDEF) {
tmp |= MAY_BE_NULL;
@@ -3102,16 +3096,9 @@ static int zend_update_type_info(const zend_op_array *op_array,
ce = NULL;
if (arg_info) {
- tmp = zend_fetch_arg_info(script, arg_info, &ce);
- if (opline->opcode == ZEND_RECV_INIT &&
- Z_TYPE_P(CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants)) == IS_CONSTANT_AST) {
- /* The constant may resolve to NULL */
- tmp |= MAY_BE_NULL;
- }
+ tmp = zend_fetch_arg_info_type(script, arg_info, &ce);
if (arg_info->pass_by_reference) {
tmp |= MAY_BE_REF;
- } else if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
- tmp |= MAY_BE_RC1|MAY_BE_RCN;
}
} else {
tmp = MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_ANY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF;
@@ -3362,6 +3349,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_FETCH_LIST_R:
case ZEND_FETCH_LIST_W:
if (ssa_ops[i].op1_def >= 0) {
+ uint32_t key_type = 0;
tmp = t1 & ~(MAY_BE_RC1|MAY_BE_RCN);
if (opline->opcode == ZEND_FETCH_DIM_W ||
opline->opcode == ZEND_FETCH_DIM_RW ||
@@ -3383,20 +3371,20 @@ static int zend_update_type_info(const zend_op_array *op_array,
tmp |= t1 & (MAY_BE_RC1|MAY_BE_RCN);
}
if (opline->op2_type == IS_UNUSED) {
- tmp |= MAY_BE_ARRAY_KEY_LONG;
+ key_type |= MAY_BE_ARRAY_KEY_LONG;
} else {
if (t2 & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) {
- tmp |= MAY_BE_ARRAY_KEY_LONG;
+ key_type |= MAY_BE_ARRAY_KEY_LONG;
}
if (t2 & MAY_BE_STRING) {
- tmp |= MAY_BE_ARRAY_KEY_STRING;
+ key_type |= MAY_BE_ARRAY_KEY_STRING;
if (opline->op2_type != IS_CONST) {
// FIXME: numeric string
- tmp |= MAY_BE_ARRAY_KEY_LONG;
+ key_type |= MAY_BE_ARRAY_KEY_LONG;
}
}
if (t2 & (MAY_BE_UNDEF | MAY_BE_NULL)) {
- tmp |= MAY_BE_ARRAY_KEY_STRING;
+ key_type |= MAY_BE_ARRAY_KEY_STRING;
}
}
} else if (opline->opcode == ZEND_FETCH_DIM_UNSET) {
@@ -3420,19 +3408,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_FETCH_LIST_W:
case ZEND_ASSIGN_DIM:
case ZEND_ASSIGN_DIM_OP:
- tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
- break;
- case ZEND_FETCH_OBJ_W:
- case ZEND_FETCH_OBJ_RW:
- case ZEND_FETCH_OBJ_FUNC_ARG:
- case ZEND_ASSIGN_OBJ:
- case ZEND_ASSIGN_OBJ_OP:
- case ZEND_ASSIGN_OBJ_REF:
- case ZEND_PRE_INC_OBJ:
- case ZEND_PRE_DEC_OBJ:
- case ZEND_POST_INC_OBJ:
- case ZEND_POST_DEC_OBJ:
- tmp |= MAY_BE_ARRAY_OF_OBJECT;
+ tmp |= key_type | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
break;
case ZEND_SEND_VAR_EX:
case ZEND_SEND_FUNC_ARG:
@@ -3447,7 +3423,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_VERIFY_RETURN_TYPE:
case ZEND_MAKE_REF:
case ZEND_FE_RESET_RW:
- tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
+ tmp |= key_type | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
break;
case ZEND_PRE_INC:
case ZEND_PRE_DEC:
@@ -3455,11 +3431,24 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_POST_DEC:
if (tmp & MAY_BE_ARRAY_OF_LONG) {
/* may overflow */
- tmp |= MAY_BE_ARRAY_OF_DOUBLE;
+ tmp |= key_type | MAY_BE_ARRAY_OF_DOUBLE;
} else if (!(tmp & (MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE))) {
- tmp |= MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE;
+ tmp |= key_type | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE;
}
break;
+ case ZEND_FETCH_OBJ_W:
+ case ZEND_FETCH_OBJ_RW:
+ case ZEND_FETCH_OBJ_FUNC_ARG:
+ case ZEND_ASSIGN_OBJ:
+ case ZEND_ASSIGN_OBJ_OP:
+ case ZEND_ASSIGN_OBJ_REF:
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ /* These will result in an error exception, unless the element
+ * is already an object. */
+ break;
case ZEND_SEND_VAR:
/* This can occur if a DIM_FETCH_FUNC_ARG with UNUSED op2 is left
* behind, because it can't be converted to DIM_FETCH_R. */
@@ -3483,18 +3472,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
opline->opcode != ZEND_FETCH_LIST_R ? t1 : ((t1 & ~MAY_BE_STRING) | MAY_BE_NULL),
opline->result_type == IS_VAR,
opline->op2_type == IS_UNUSED);
- if (opline->opcode == ZEND_FETCH_DIM_W ||
- opline->opcode == ZEND_FETCH_DIM_RW ||
- opline->opcode == ZEND_FETCH_DIM_FUNC_ARG ||
- opline->opcode == ZEND_FETCH_LIST_W) {
- if (t1 & (MAY_BE_ERROR|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_RESOURCE|MAY_BE_OBJECT)) {
- tmp |= MAY_BE_ERROR;
- } else if (opline->op2_type == IS_UNUSED) {
- tmp |= MAY_BE_ERROR;
- } else if (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT)) {
- tmp |= MAY_BE_ERROR;
- }
- } else if (opline->opcode == ZEND_FETCH_DIM_IS && (t1 & MAY_BE_STRING)) {
+ if (opline->opcode == ZEND_FETCH_DIM_IS && (t1 & MAY_BE_STRING)) {
tmp |= MAY_BE_NULL;
}
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
@@ -3509,26 +3487,11 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_FETCH_OBJ_W:
case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_OBJ_FUNC_ARG:
- if (ssa_ops[i].op1_def >= 0) {
- tmp = t1;
- if (opline->opcode == ZEND_FETCH_OBJ_W ||
- opline->opcode == ZEND_FETCH_OBJ_RW ||
- opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) {
- if (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) {
- if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
- tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
- tmp |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
- }
- }
- }
- UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
- COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
- }
if (ssa_ops[i].result_def >= 0) {
tmp = zend_fetch_prop_type(script,
zend_fetch_prop_info(op_array, ssa, opline, i), &ce);
if (opline->result_type != IS_TMP_VAR) {
- tmp |= MAY_BE_REF | MAY_BE_ERROR;
+ tmp |= MAY_BE_REF;
}
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
if (ce) {
@@ -3545,7 +3508,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
tmp = zend_fetch_prop_type(script,
zend_fetch_static_prop_info(script, op_array, ssa, opline), &ce);
if (opline->result_type != IS_TMP_VAR) {
- tmp |= MAY_BE_REF | MAY_BE_ERROR;
+ tmp |= MAY_BE_REF;
}
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
if (ce) {
@@ -3567,7 +3530,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
if (!call_info) {
goto unknown_opcode;
}
- tmp = zend_get_func_info(call_info, ssa) & ~FUNC_MAY_WARN;
+ tmp = zend_get_func_info(call_info, ssa);
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
if (call_info->callee_func->type == ZEND_USER_FUNCTION) {
func_info = ZEND_FUNC_INFO(&call_info->callee_func->op_array);
@@ -3615,11 +3578,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
ce = NULL;
} else {
zend_arg_info *ret_info = op_array->arg_info - 1;
-
- tmp = zend_fetch_arg_info(script, ret_info, &ce);
- if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
- tmp |= MAY_BE_RC1 | MAY_BE_RCN;
- }
+ tmp = zend_fetch_arg_info_type(script, ret_info, &ce);
}
if (opline->op1_type & (IS_TMP_VAR|IS_VAR|IS_CV)) {
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
@@ -4046,11 +4005,9 @@ void zend_init_func_return_info(const zend_op_array *op_array,
zend_arg_info *ret_info = op_array->arg_info - 1;
zend_ssa_range tmp_range = {0, 0, 0, 0};
- ret->type = zend_fetch_arg_info(script, ret_info, &ret->ce);
+ ret->type = zend_fetch_arg_info_type(script, ret_info, &ret->ce);
if (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) {
ret->type |= MAY_BE_REF;
- } else if (ret->type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
- ret->type |= MAY_BE_RC1|MAY_BE_RCN;
}
ret->is_instanceof = (ret->ce) ? 1 : 0;
ret->range = tmp_range;
diff --git a/ext/opcache/Optimizer/zend_inference.h b/ext/opcache/Optimizer/zend_inference.h
index ec98fcbef9..2e5a44d0be 100644
--- a/ext/opcache/Optimizer/zend_inference.h
+++ b/ext/opcache/Optimizer/zend_inference.h
@@ -26,11 +26,11 @@
/* Bitmask for type inference (zend_ssa_var_info.type) */
#include "zend_type_info.h"
-#define MAY_BE_IN_REG (1<<25) /* value allocated in CPU register */
+#define MAY_BE_IN_REG (1<<29) /* value allocated in CPU register */
//TODO: remome MAY_BE_RC1, MAY_BE_RCN???
-#define MAY_BE_RC1 (1<<27) /* may be non-reference with refcount == 1 */
-#define MAY_BE_RCN (1<<28) /* may be non-reference with refcount > 1 */
+#define MAY_BE_RC1 (1<<30) /* may be non-reference with refcount == 1 */
+#define MAY_BE_RCN (1u<<31) /* may be non-reference with refcount > 1 */
#define MAY_HAVE_DTOR \
(MAY_BE_OBJECT|MAY_BE_RESOURCE \
@@ -199,7 +199,7 @@ static zend_always_inline uint32_t get_ssa_var_info(const zend_ssa *ssa, int ssa
if (ssa->var_info && ssa_var_num >= 0) {
return ssa->var_info[ssa_var_num].type;
} else {
- return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ERROR;
+ return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
}
}
@@ -263,6 +263,8 @@ void zend_inference_check_recursive_dependencies(zend_op_array *op_array);
int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_bitset worklist, zend_long optimization_level);
+uint32_t zend_fetch_arg_info_type(
+ const zend_script *script, zend_arg_info *arg_info, zend_class_entry **pce);
void zend_init_func_return_info(const zend_op_array *op_array,
const zend_script *script,
zend_ssa_var_info *ret);
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index a922d0f597..7bac2d7538 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -657,8 +657,8 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
case ZEND_VERIFY_RETURN_TYPE: {
zend_arg_info *ret_info = op_array->arg_info - 1;
if (ZEND_TYPE_IS_CLASS(ret_info->type)
- || ZEND_TYPE_CODE(ret_info->type) == IS_CALLABLE
- || !ZEND_SAME_FAKE_TYPE(ZEND_TYPE_CODE(ret_info->type), Z_TYPE_P(val))
+ || (ZEND_TYPE_IS_MASK(ret_info->type)
+ && !ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(val)))
|| (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
return 0;
}
@@ -897,14 +897,8 @@ uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args)
return ZEND_FUNC_INDIRECT_VAR_ACCESS;
} else if (zend_string_equals_literal(name, "compact")) {
return ZEND_FUNC_INDIRECT_VAR_ACCESS;
- } else if (zend_string_equals_literal(name, "parse_str") && num_args <= 1) {
- return ZEND_FUNC_INDIRECT_VAR_ACCESS;
- } else if (zend_string_equals_literal(name, "mb_parse_str") && num_args <= 1) {
- return ZEND_FUNC_INDIRECT_VAR_ACCESS;
} else if (zend_string_equals_literal(name, "get_defined_vars")) {
return ZEND_FUNC_INDIRECT_VAR_ACCESS;
- } else if (zend_string_equals_literal(name, "assert")) {
- return ZEND_FUNC_INDIRECT_VAR_ACCESS;
} else if (zend_string_equals_literal(name, "func_num_args")) {
return ZEND_FUNC_VARARG;
} else if (zend_string_equals_literal(name, "func_get_arg")) {
diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c
index 9d3b81ca83..4ef7afe705 100644
--- a/ext/opcache/Optimizer/zend_ssa.c
+++ b/ext/opcache/Optimizer/zend_ssa.c
@@ -742,10 +742,6 @@ static int zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags,
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
case ZEND_FETCH_DIM_UNSET:
- case ZEND_FETCH_OBJ_W:
- case ZEND_FETCH_OBJ_RW:
- case ZEND_FETCH_OBJ_FUNC_ARG:
- case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_LIST_W:
if (opline->op1_type == IS_CV) {
ssa_ops[k].op1_def = ssa_vars_count;
@@ -1125,8 +1121,6 @@ int zend_ssa_compute_use_def_chains(zend_arena **arena, const zend_op_array *op_
for (i = 0; i < op_array->last_var; i++) {
if ((ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS)) {
ssa_vars[i].alias = SYMTABLE_ALIAS;
- } else if (zend_string_equals_literal(op_array->vars[i], "php_errormsg")) {
- ssa_vars[i].alias = PHP_ERRORMSG_ALIAS;
} else if (zend_string_equals_literal(op_array->vars[i], "http_response_header")) {
ssa_vars[i].alias = HTTP_RESPONSE_HEADER_ALIAS;
}
diff --git a/ext/opcache/Optimizer/zend_ssa.h b/ext/opcache/Optimizer/zend_ssa.h
index a921a5bbe0..9b53b73e7e 100644
--- a/ext/opcache/Optimizer/zend_ssa.h
+++ b/ext/opcache/Optimizer/zend_ssa.h
@@ -95,7 +95,6 @@ typedef struct _zend_ssa_op {
typedef enum _zend_ssa_alias_kind {
NO_ALIAS,
SYMTABLE_ALIAS,
- PHP_ERRORMSG_ALIAS,
HTTP_RESPONSE_HEADER_ALIAS
} zend_ssa_alias_kind;