[php-src] Issue #8296: Numeric casts must emit a warning it they do not make sense
| From: | iluuu1994 | Date: | Thu, 07 Apr 2022 10:16:50 +0000 |
| Subject: | [php-src] Issue #8296: Numeric casts must emit a warning it they do not make sense | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240730@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8296
Comment Author: iluuu1994
> his is about preventing the whole class of arrays, and not specific patterns of arrays
We also throw when casting non-stringable objects to strings, while stringable objects are obviously
allowed.
> "just squeeze that into a number". It's a safe way of doing that which existed
> since very old times and should stay.
Yeah, that's a valid concern.
(int)$foo !== 0 is probably a common pattern when
0 is not a valid value.