php-src/Zend/tests/array_offset.phpt
Ayesh Karunaratne b8e380ab09 Update deprecation message for incompatible float to int conversion
Updates the deprecation message for implicit incompatible float to int conversion from:

```
Implicit conversion from non-compatible float %.*H to int in %s on line %d
```

to

```
Implicit conversion from float %.*H to int loses precision in %s on line %d
```

Related: #6661
2021-06-07 14:36:11 +02:00

26 lines
594 B
PHP

--TEST--
Ensure "undefined offset" notice formats message correctly when undefined key is negative
--FILE--
<?php
[][-1];
[][-1.1];
(new ArrayObject)[-1];
(new ArrayObject)[-1.1];
echo "Done\n";
?>
--EXPECTF--
Warning: Undefined array key -1 in %s on line %d
Deprecated: Implicit conversion from float -1.1 to int loses precision in %s on line %d
Warning: Undefined array key -1 in %s on line %d
Warning: Undefined array key -1 in %s on line %d
Deprecated: Implicit conversion from float -1.1 to int loses precision in %s on line %d
Warning: Undefined array key -1 in %s on line %d
Done