@@ -132,6 +132,81 @@ OUTPUT;
132132
133133$ EXPECTED_OUTPUT_FLOAT_OFFSETS_REGEX = '/^ ' . expectf_to_regex (EXPECTF_OUTPUT_FLOAT_OFFSETS ) . '$/s ' ;
134134
135+ const EXPECTED_OUTPUT_NULL_OFFSETS = <<<OUTPUT
136+ Read before write:
137+
138+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
139+
140+ Warning: Undefined array key "" in %s on line %d
141+ NULL
142+ Write:
143+
144+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
145+ Read:
146+
147+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
148+ int(5)
149+ Read-Write:
150+
151+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
152+ isset():
153+ bool(true)
154+ empty():
155+ bool(false)
156+ null coalesce:
157+
158+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
159+ int(25)
160+ Reference to dimension:
161+
162+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
163+ Value of reference:
164+ int(25)
165+ Value of container dimension after write to reference (should be int(100) if successful):
166+
167+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
168+ int(100)
169+ unset():
170+ Nested read:
171+
172+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
173+
174+ Warning: Undefined array key "" in %s on line %d
175+
176+ Warning: Trying to access array offset on null in %s on line %d
177+ NULL
178+ Nested write:
179+
180+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
181+
182+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
183+ Nested Read-Write:
184+
185+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
186+
187+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
188+ Nested isset():
189+
190+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
191+ bool(true)
192+ Nested empty():
193+
194+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
195+ bool(false)
196+ Nested null coalesce:
197+
198+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
199+
200+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
201+ int(30)
202+ Nested unset():
203+
204+ Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
205+
206+ OUTPUT ;
207+
208+ $ EXPECTED_OUTPUT_NULL_OFFSETS_REGEX = '/^ ' . expectf_to_regex (EXPECTED_OUTPUT_NULL_OFFSETS ) . '$/s ' ;
209+
135210const EXPECTED_OUTPUT_INVALID_OFFSETS = <<<OUTPUT
136211Read before write:
137212Cannot access offset of type %s on array
@@ -273,6 +348,7 @@ foreach ($offsets as $dimension) {
273348 !preg_match ($ EXPECTED_OUTPUT_VALID_OFFSETS_REGEX , $ varOutput )
274349 && !preg_match ($ EXPECTED_OUTPUT_INVALID_OFFSETS_REGEX , $ varOutput )
275350 && !preg_match ($ EXPECTED_OUTPUT_FLOAT_OFFSETS_REGEX , $ varOutput )
351+ && !preg_match ($ EXPECTED_OUTPUT_NULL_OFFSETS_REGEX , $ varOutput )
276352 && $ varOutput !== EXPECTED_OUTPUT_RESOURCE_STDERR_OFFSETS
277353 ) {
278354 file_put_contents (__DIR__ . DIRECTORY_SEPARATOR . "debug_array_container_ {$ failuresNb }.txt " , $ varOutput );
@@ -300,6 +376,7 @@ foreach ($offsets as $offset) {
300376 !preg_match ($ EXPECTED_OUTPUT_VALID_OFFSETS_REGEX , $ varOutput )
301377 && !preg_match ($ EXPECTED_OUTPUT_INVALID_OFFSETS_REGEX , $ varOutput )
302378 && !preg_match ($ EXPECTED_OUTPUT_FLOAT_OFFSETS_REGEX , $ varOutput )
379+ && !preg_match ($ EXPECTED_OUTPUT_NULL_OFFSETS_REGEX , $ varOutput )
303380 && $ varOutput !== EXPECTED_OUTPUT_RESOURCE_STDERR_OFFSETS
304381 ) {
305382 file_put_contents (__DIR__ . DIRECTORY_SEPARATOR . "debug_array_container_ {$ failuresNb }.txt " , $ varOutput );
0 commit comments