obj = opline->op1.zv;
if (IS_CONST == IS_CONST ||
- (IS_CONST == IS_VAR && UNEXPECTED(obj == NULL)) ||
UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "__clone method called on non-object");
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
SAVE_OPLINE();
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
opline->op2.zv TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op2;
SAVE_OPLINE();
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op2;
SAVE_OPLINE();
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
SAVE_OPLINE();
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
obj = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
if (IS_TMP_VAR == IS_CONST ||
- (IS_TMP_VAR == IS_VAR && UNEXPECTED(obj == NULL)) ||
UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "__clone method called on non-object");
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1;
SAVE_OPLINE();
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- zval_dtor(free_op1.var);
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- zval_dtor(free_op1.var);
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- zval_dtor(free_op1.var);
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1;
SAVE_OPLINE();
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- zval_dtor(free_op1.var);
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
obj = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_CONST ||
- (IS_VAR == IS_VAR && UNEXPECTED(obj == NULL)) ||
UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "__clone method called on non-object");
}
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1;
SAVE_OPLINE();
if (IS_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR != IS_VAR || container) {
-
- zval *offset = opline->op2.zv;
+ offset = opline->op2.zv;
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_CONST == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_CONST == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
-
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
-
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
+ }
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
-
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+
+ } else {
+
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
zval_dtor(free_op2.var);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
}
zval_dtor(free_op2.var);
static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
if (IS_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- zend_free_op free_op1;
+ zend_free_op free_op1, free_op2;
zval **container;
zval **value = NULL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR != IS_VAR || container) {
- zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_TMP_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_TMP_VAR == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
- zval_dtor(free_op2.var);
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (1) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (1) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
- zval_dtor(free_op2.var);
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
-
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ }
+ zval_dtor(free_op2.var);
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (1) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
- zval_dtor(free_op2.var);
+ }
+ if (1) {
+ zval_ptr_dtor(&offset);
} else {
zval_dtor(free_op2.var);
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+ zval_dtor(free_op2.var);
+ } else {
+ zval_dtor(free_op2.var);
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
}
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
if (IS_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- zend_free_op free_op1;
+ zend_free_op free_op1, free_op2;
zval **container;
zval **value = NULL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR != IS_VAR || container) {
- zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_VAR == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
-
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ }
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ } else {
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
}
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op1;
SAVE_OPLINE();
if (IS_VAR==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
- if (IS_VAR != IS_VAR || container) {
-
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_CV == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_CV == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
-
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
-
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
+ }
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
-
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+
+ } else {
+
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
obj = _get_obj_zval_ptr_unused(TSRMLS_C);
if (IS_UNUSED == IS_CONST ||
- (IS_UNUSED == IS_VAR && UNEXPECTED(obj == NULL)) ||
UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "__clone method called on non-object");
}
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
- if (IS_UNUSED != IS_VAR || container) {
-
- zval *offset = opline->op2.zv;
+ offset = opline->op2.zv;
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_CONST == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_CONST == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
-
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
-
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
+ }
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
-
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+
+ } else {
+
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
-
+ zend_free_op free_op2;
zval **container;
zval **value = NULL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
- if (IS_UNUSED != IS_VAR || container) {
- zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_TMP_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_TMP_VAR == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
- zval_dtor(free_op2.var);
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (1) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (1) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
- zval_dtor(free_op2.var);
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
-
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ }
+ zval_dtor(free_op2.var);
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (1) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
- zval_dtor(free_op2.var);
+ }
+ if (1) {
+ zval_ptr_dtor(&offset);
} else {
zval_dtor(free_op2.var);
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+ zval_dtor(free_op2.var);
+ } else {
+ zval_dtor(free_op2.var);
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
-
+ zend_free_op free_op2;
zval **container;
zval **value = NULL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
- if (IS_UNUSED != IS_VAR || container) {
- zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_VAR == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
-
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ }
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ } else {
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
- if (IS_UNUSED != IS_VAR || container) {
-
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_CV == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_CV == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
-
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
-
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
+ }
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
-
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+
+ } else {
+
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
obj = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
if (IS_CV == IS_CONST ||
- (IS_CV == IS_VAR && UNEXPECTED(obj == NULL)) ||
UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "__clone method called on non-object");
}
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
-
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
SAVE_OPLINE();
if (IS_CV==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV != IS_VAR || container) {
-
- zval *offset = opline->op2.zv;
+ offset = opline->op2.zv;
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_CONST == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_CONST == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
-
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
-
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
+ }
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
-
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+
+ } else {
+
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
-
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
zval_dtor(free_op2.var);
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
}
zval_dtor(free_op2.var);
static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op2;
SAVE_OPLINE();
if (IS_CV==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
-
+ zend_free_op free_op2;
zval **container;
zval **value = NULL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV != IS_VAR || container) {
- zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_TMP_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_TMP_VAR == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
- zval_dtor(free_op2.var);
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (1) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (1) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
- zval_dtor(free_op2.var);
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
-
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ }
+ zval_dtor(free_op2.var);
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (1) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
- zval_dtor(free_op2.var);
+ }
+ if (1) {
+ zval_ptr_dtor(&offset);
} else {
zval_dtor(free_op2.var);
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+ zval_dtor(free_op2.var);
+ } else {
+ zval_dtor(free_op2.var);
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
-
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
}
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
zend_free_op free_op2;
SAVE_OPLINE();
if (IS_CV==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
-
+ zend_free_op free_op2;
zval **container;
zval **value = NULL;
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV != IS_VAR || container) {
- zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_VAR == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
-
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ }
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ } else {
+ if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
}
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
-
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- }
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
}
static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- int switch_expr_is_overloaded=0;
SAVE_OPLINE();
if (IS_CV==IS_VAR) {
- if (EX_T(opline->op1.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- } else {
- switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
- }
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
}
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (switch_expr_is_overloaded) {
- /* We only free op1 if this is a string offset,
- * Since if it is a TMP_VAR, it'll be reused by
- * other CASE opcodes (whereas string offsets
- * are allocated at each get_zval_ptr())
- */
-
- EX_T(opline->op1.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.var).var.ptr = NULL;
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
int result = 0;
ulong hval;
long index;
+ zval *offset;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
- if (IS_CV != IS_VAR || container) {
-
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
- if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
- HashTable *ht;
- int isset = 0;
+ if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
+ HashTable *ht;
+ int isset = 0;
- ht = Z_ARRVAL_PP(container);
+ ht = Z_ARRVAL_PP(container);
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- index = zend_dval_to_lval(Z_DVAL_P(offset));
- goto num_index_prop;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- index = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index_prop;
+ case IS_RESOURCE:
+ case IS_BOOL:
+ case IS_LONG:
+ index = Z_LVAL_P(offset);
num_index_prop:
- if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
- isset = 1;
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
+ case IS_STRING:
+ if (IS_CV == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
}
- break;
- case IS_STRING:
- if (IS_CV == IS_CONST) {
- hval = Z_HASH_P(offset);
+ if (IS_INTERNED(Z_STRVAL_P(offset))) {
+ hval = INTERNED_HASH(Z_STRVAL_P(offset));
} else {
- if (!prop_dim) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index_prop);
- }
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
- }
- if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
- case IS_NULL:
- if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
- isset = 1;
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
}
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in isset or empty");
-
- break;
- }
-
- if (opline->extended_value & ZEND_ISSET) {
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
}
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
+ isset = 1;
}
- }
-
- } else if (Z_TYPE_PP(container) == IS_OBJECT) {
- if (0) {
- MAKE_REAL_ZVAL_PTR(offset);
- }
- if (prop_dim) {
- if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check property of non-object");
- result = 0;
+ break;
+ case IS_NULL:
+ if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
+ isset = 1;
}
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in isset or empty");
+ break;
+ }
+
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
} else {
- if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
- } else {
- zend_error(E_NOTICE, "Trying to check element of non-array");
- result = 0;
- }
+ result = isset;
}
- if (0) {
- zval_ptr_dtor(&offset);
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
} else {
-
+ result = 1;
}
- } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
- zval tmp;
+ }
- if (Z_TYPE_P(offset) != IS_LONG) {
- ZVAL_COPY_VALUE(&tmp, offset);
- zval_copy_ctor(&tmp);
- convert_to_long(&tmp);
- offset = &tmp;
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
+ if (0) {
+ MAKE_REAL_ZVAL_PTR(offset);
+ }
+ if (prop_dim) {
+ if (Z_OBJ_HT_P(*container)->has_property) {
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check property of non-object");
+ result = 0;
}
- if (Z_TYPE_P(offset) == IS_LONG) {
- if (opline->extended_value & ZEND_ISSET) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- }
+ } else {
+ if (Z_OBJ_HT_P(*container)->has_dimension) {
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
+ } else {
+ zend_error(E_NOTICE, "Trying to check element of non-array");
+ result = 0;
}
-
+ }
+ if (0) {
+ zval_ptr_dtor(&offset);
} else {
}
+ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
+ zval tmp;
+
+ if (Z_TYPE_P(offset) != IS_LONG) {
+ ZVAL_COPY_VALUE(&tmp, offset);
+ zval_copy_ctor(&tmp);
+ convert_to_long(&tmp);
+ offset = &tmp;
+ }
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
+ }
+ }
+
+ } else {
+
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;