@@ -317,7 +317,11 @@ static inline zval **spl_fixedarray_object_read_dimension_helper(spl_fixedarray_
317
317
return NULL ;
318
318
}
319
319
320
- index = spl_offset_convert_to_long (offset TSRMLS_CC );
320
+ if (Z_TYPE_P (offset ) != IS_LONG ) {
321
+ index = spl_offset_convert_to_long (offset TSRMLS_CC );
322
+ } else {
323
+ index = Z_LVAL_P (offset );
324
+ }
321
325
322
326
if (index < 0 || intern -> array == NULL || index >= intern -> array -> size ) {
323
327
zend_throw_exception (spl_ce_RuntimeException , "Index invalid or out of range" , 0 TSRMLS_CC );
@@ -369,7 +373,11 @@ static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_o
369
373
return ;
370
374
}
371
375
372
- index = spl_offset_convert_to_long (offset TSRMLS_CC );
376
+ if (Z_TYPE_P (offset ) != IS_LONG ) {
377
+ index = spl_offset_convert_to_long (offset TSRMLS_CC );
378
+ } else {
379
+ index = Z_LVAL_P (offset );
380
+ }
373
381
374
382
if (index < 0 || intern -> array == NULL || index >= intern -> array -> size ) {
375
383
zend_throw_exception (spl_ce_RuntimeException , "Index invalid or out of range" , 0 TSRMLS_CC );
@@ -407,7 +415,11 @@ static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_o
407
415
{
408
416
long index ;
409
417
410
- index = spl_offset_convert_to_long (offset TSRMLS_CC );
418
+ if (Z_TYPE_P (offset ) != IS_LONG ) {
419
+ index = spl_offset_convert_to_long (offset TSRMLS_CC );
420
+ } else {
421
+ index = Z_LVAL_P (offset );
422
+ }
411
423
412
424
if (index < 0 || intern -> array == NULL || index >= intern -> array -> size ) {
413
425
zend_throw_exception (spl_ce_RuntimeException , "Index invalid or out of range" , 0 TSRMLS_CC );
@@ -444,7 +456,11 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
444
456
long index ;
445
457
int retval ;
446
458
447
- index = spl_offset_convert_to_long (offset TSRMLS_CC );
459
+ if (Z_TYPE_P (offset ) != IS_LONG ) {
460
+ index = spl_offset_convert_to_long (offset TSRMLS_CC );
461
+ } else {
462
+ index = Z_LVAL_P (offset );
463
+ }
448
464
449
465
if (index < 0 || intern -> array == NULL || index >= intern -> array -> size ) {
450
466
retval = 0 ;
0 commit comments