xref: /PHP-8.0/Zend/tests/array_offset.phpt (revision c48b745f)
1--TEST--
2Ensure "undefined offset" notice formats message correctly when undefined key is negative
3--FILE--
4<?php
5
6[][-1];
7[][-1.1];
8(new ArrayObject)[-1];
9(new ArrayObject)[-1.1];
10
11echo "Done\n";
12?>
13--EXPECTF--
14Warning: Undefined array key -1 in %s on line %d
15
16Warning: Undefined array key -1 in %s on line %d
17
18Warning: Undefined array key -1 in %s on line %d
19
20Warning: Undefined array key -1 in %s on line %d
21Done
22