Skip to content

Commit cc2147d

Browse files
committed
Merge branch 'PHP-7.0'
2 parents ee864f8 + 311eb2b commit cc2147d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

ext/spl/spl_array.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,8 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
514514
return;
515515
}
516516

517-
switch(Z_TYPE_P(offset)) {
517+
try_again:
518+
switch (Z_TYPE_P(offset)) {
518519
case IS_STRING:
519520
ht = spl_array_get_hash_table(intern, 0);
520521
if (ht->u.v.nApplyCount > 0) {
@@ -574,6 +575,9 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
574575
zend_error(E_NOTICE,"Undefined offset: %pd", index);
575576
}
576577
break;
578+
case IS_REFERENCE:
579+
ZVAL_DEREF(offset);
580+
goto try_again;
577581
default:
578582
zend_error(E_WARNING, "Illegal offset type");
579583
return;

ext/spl/tests/bug71028.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ cast($b);
1414

1515
var_dump(isset($a[$b]));
1616
$a[$b] = "okey";
17-
echo $a[$b];
17+
var_dump($a[$b]);
18+
unset($a[$b]);
19+
var_dump(isset($a[$b]));
1820
?>
1921
--EXPECT--
2022
bool(true)
21-
okey
23+
string(4) "okey"
24+
bool(false)

0 commit comments

Comments
 (0)