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