Skip to content

Commit 3f62207

Browse files
Remove compile-time HANDLE_NUMERIC (see bug #63217)
1 parent bab7581 commit 3f62207

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Zend/tests/list_keyed_ArrayAccess.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,31 @@ $antonymObject["happy"] = "sad";
1010
list("good" => $good, "happy" => $happy) = $antonymObject;
1111
var_dump($good, $happy);
1212

13+
echo PHP_EOL;
14+
15+
class IndexPrinter implements ArrayAccess
16+
{
17+
public function offsetGet($offset) {
18+
echo "GET ";
19+
var_dump($offset);
20+
}
21+
public function offsetSet($offset, $value) {
22+
}
23+
public function offsetExists($offset) {
24+
}
25+
public function offsetUnset($offset) {
26+
}
27+
}
28+
29+
$op = new IndexPrinter;
30+
list(123 => $x) = $op;
31+
// PHP shouldn't convert this to an integer offset, because it's ArrayAccess
32+
list("123" => $x) = $op;
33+
1334
?>
1435
--EXPECT--
1536
string(3) "bad"
1637
string(3) "sad"
38+
39+
GET int(123)
40+
GET string(3) "123"

Zend/zend_compile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,6 @@ static void zend_compile_keyed_list_assign(zend_ast_list *list, znode *expr_node
27512751
znode fetch_result, dim_node;
27522752

27532753
zend_compile_expr(&dim_node, key_ast);
2754-
zend_handle_numeric_op(&dim_node);
27552754

27562755
if (expr_node->op_type == IS_CONST) {
27572756
Z_TRY_ADDREF(expr_node->u.constant);

0 commit comments

Comments
 (0)