1--TEST--
2JIT ASSIGN_DIM_OP: 001
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7--EXTENSIONS--
8opcache
9--FILE--
10<?php
11function test1() {
12    $x = "a";
13    $a[$x . "b"] = 0;
14    $a[$x . "b"] += 2;
15    var_dump($a);
16}
17test1();
18
19function false_to_array($a) {
20    $a[2] += 1;
21    return $a;
22}
23function false_to_array_append($a) {
24    $a[] += 1;
25    return $a;
26}
27function false_to_array_invalid_index($a) {
28    var_dump($a[[]] += 1);
29    return $a;
30}
31function false_to_array_nested($a) {
32    $a[2][3] += 1;
33    return $a;
34}
35function false_to_array_nested_append($a) {
36    $a[][] += 1;
37    return $a;
38}
39function false_to_array_nested_invalid_index($a) {
40    $a[[]][0] += 1;
41    return $a;
42}
43function modulo_string($a) {
44    $a[] %= "";
45}
46
47false_to_array(false);
48false_to_array_append(false);
49try {
50    var_dump(false_to_array_invalid_index(false));
51} catch (Error $e) {
52    echo $e->getMessage(), "\n";
53}
54var_dump(false_to_array_nested(false));
55var_dump(false_to_array_nested_append(false));
56try {
57    var_dump(false_to_array_nested_invalid_index(false));
58} catch (Error $e) {
59    echo $e->getMessage(), "\n";
60}
61try {
62    var_dump(modulo_string([]));
63} catch (TypeError $e) {
64    echo $e->getMessage(), "\n";
65}
66
67?>
68--EXPECTF--
69array(1) {
70  ["ab"]=>
71  int(2)
72}
73
74Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
75
76Warning: Undefined array key 2 in %s on line %d
77
78Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
79
80Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
81Cannot access offset of type array on array
82
83Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
84
85Warning: Undefined array key 2 in %s on line %d
86
87Warning: Undefined array key 3 in %s on line %d
88array(1) {
89  [2]=>
90  array(1) {
91    [3]=>
92    int(1)
93  }
94}
95
96Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
97array(1) {
98  [0]=>
99  array(1) {
100    [0]=>
101    int(1)
102  }
103}
104
105Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
106Cannot access offset of type array on array
107Unsupported operand types: null % string
108