xref: /PHP-8.1/Zend/tests/array_offset.phpt (revision b8e380ab)
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
16Deprecated: Implicit conversion from float -1.1 to int loses precision 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
21
22Deprecated: Implicit conversion from float -1.1 to int loses precision in %s on line %d
23
24Warning: Undefined array key -1 in %s on line %d
25Done
26