[php-src] Issue #8296: Numeric casts show emit a warning it they do not make sense
| From: | mvorisek | Date: | Sun, 03 Apr 2022 11:15:43 +0000 |
| Subject: | [php-src] Issue #8296: Numeric casts show emit a warning it they do not make sense | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240648@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8296
Author: mvorisek
### Description
```
(float) '1';
(float) '1.0';
(float) '';
(float) 'x'; // should always warn
(int) '1';
(int) '1.0';
(int) '';
(int) 'x'; // should always warn
```
https://3v4l.org/gDLOv
This is a feature request. The casts above are advised by many static analysers, but if added
explicitly, there is currently no warning emit. They should at least emit a warning if the input is
not numerical and the cast does not make sense.