diff options
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index e24a3dd6f2..3474ee43cd 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1147,13 +1147,22 @@ convert_to_array: } if (Z_TYPE_P(dim) != IS_LONG) { + switch(Z_TYPE_P(dim)) { /* case IS_LONG: */ case IS_STRING: + if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) { + break; + } + if (type != BP_VAR_UNSET) { + zend_error(E_WARNING, "Illegal string offset '%s'", dim->value.str.val); + } + + break; case IS_DOUBLE: case IS_NULL: case IS_BOOL: - /* do nothing */ + zend_error(E_NOTICE, "String offset cast occured"); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -1265,10 +1274,19 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont switch(Z_TYPE_P(dim)) { /* case IS_LONG: */ case IS_STRING: + if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) { + break; + } + if (type != BP_VAR_IS) { + zend_error(E_WARNING, "Illegal string offset '%s'", dim->value.str.val); + } + break; case IS_DOUBLE: case IS_NULL: case IS_BOOL: - /* do nothing */ + if (type != BP_VAR_IS) { + zend_error(E_NOTICE, "String offset cast occured"); + } break; default: zend_error(E_WARNING, "Illegal offset type"); |
