@@ -276,6 +276,7 @@ static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval
276
276
return & EG (error_zval );;
277
277
}
278
278
279
+ try_again :
279
280
switch (Z_TYPE_P (offset )) {
280
281
case IS_NULL :
281
282
offset_key = ZSTR_EMPTY_ALLOC ();
@@ -355,6 +356,9 @@ static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval
355
356
}
356
357
}
357
358
return retval ;
359
+ case IS_REFERENCE :
360
+ ZVAL_DEREF (offset );
361
+ goto try_again ;
358
362
default :
359
363
zend_error (E_WARNING , "Illegal offset type" );
360
364
return (type == BP_VAR_W || type == BP_VAR_RW ) ?
@@ -442,6 +446,8 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
442
446
if (Z_REFCOUNTED_P (value )) {
443
447
Z_ADDREF_P (value );
444
448
}
449
+
450
+ try_again :
445
451
switch (Z_TYPE_P (offset )) {
446
452
case IS_STRING :
447
453
ht = spl_array_get_hash_table (intern , 0 );
@@ -481,6 +487,9 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
481
487
}
482
488
zend_hash_next_index_insert (ht , value );
483
489
return ;
490
+ case IS_REFERENCE :
491
+ ZVAL_DEREF (offset );
492
+ goto try_again ;
484
493
default :
485
494
zend_error (E_WARNING , "Illegal offset type" );
486
495
return ;
@@ -603,7 +612,8 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
603
612
if (!value ) {
604
613
HashTable * ht = spl_array_get_hash_table (intern , 0 );
605
614
606
- switch (Z_TYPE_P (offset )) {
615
+ try_again :
616
+ switch (Z_TYPE_P (offset )) {
607
617
case IS_STRING :
608
618
if ((tmp = zend_symtable_find (ht , Z_STR_P (offset ))) != NULL ) {
609
619
if (check_empty == 2 ) {
@@ -637,7 +647,9 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
637
647
return 0 ;
638
648
}
639
649
break ;
640
-
650
+ case IS_REFERENCE :
651
+ ZVAL_DEREF (offset );
652
+ goto try_again ;
641
653
default :
642
654
zend_error (E_WARNING , "Illegal offset type" );
643
655
return 0 ;
0 commit comments