[php-src] Issue #10025: "Implicit conversion from float to int" deprecation messages without file and line
| From: | bburnichon | Date: | Wed, 30 Nov 2022 17:05:58 +0000 |
| Subject: | [php-src] Issue #10025: "Implicit conversion from float to int" deprecation messages without file and line | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243004@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10025
Author: bburnichon
### Description
In my production code, I sometimes have errors about
Implicit conversion from float to int
loses precision.
I am fine with it, except that it does not indicate any file / line where the error occurred.
I do have exception/Error handlers that catch the issue but are unable to locate the issue.
I can not reproduce the same behavior locally.
I am working with a huge codebase (more than 500k LOC) so it is really hard to find from where these
errors come from.
The following code:
```php
<?php
$test = static function (): int {
return 4.2;
}
$test();
```
Resulted in this output:
```
PHP Deprecated: Implicit conversion from float 4.2 to int loses precision
```
But I expected this output instead:
```
PHP Deprecated: Implicit conversion from float 4.2 to int loses precision in
/path/to/file/with/error.php on line 4
```
### PHP Version
8.1.4
### Operating System
Ubuntu 22.04.1 LTS