Skip to content

Commit c2a90cc

Browse files
committed
Revert string offset semantics
1 parent 17a32a9 commit c2a90cc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/spl/spl_fixedarray.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,15 @@ static zend_object *spl_fixedarray_object_clone(zend_object *old_object)
311311

312312
static zend_long spl_offset_convert_to_long(zval *offset) /* {{{ */
313313
{
314-
zend_long index;
315-
316314
try_again:
317315
switch (Z_TYPE_P(offset)) {
318-
case IS_STRING:
319-
if (IS_LONG == is_numeric_str_function(Z_STR_P(offset), &index, NULL)) {
320-
return index;
316+
case IS_STRING: {
317+
zend_ulong index;
318+
if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), index)) {
319+
return (zend_long) index;
321320
}
322321
break;
322+
}
323323
case IS_DOUBLE:
324324
return zend_dval_to_lval_safe(Z_DVAL_P(offset));
325325
case IS_LONG:

0 commit comments

Comments
 (0)