Re: Are warnings guaranteed?
| From: | Marco Pivetta | Date: | Thu, 14 Dec 2023 11:12:23 +0000 |
| Subject: | Re: Are warnings guaranteed? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122003@lists.php.net to get a copy of this message | ||
Hey Boris,
On Thu, 14 Dec 2023 at 11:39, petrov.boris.v.mail.ru via internals <
internals@lists.php.net> wrote:
> The above code confuses a reader with issues 1) isn't the only possible
> return value is now true? 2) if it throws on failure, then how can it
> return anything?
>
Just worth mentioning that
https://github.com/thecodingmachine/safe/tree/3a6e43b4be3d3d65b272c2660300a50658ce168b
maps out all warning-emitting PHP functions to usable variants :-)
There's also a PHPStan integration to prevent people from shooting
themselves in the foot while using the php-src provided legacy functions
(which will likely keep emitting warnings for a while, due to BC concerns).
Marco Pivetta
https://mastodon.social/@ocramius
https://ocramius.github.io/