Re: [RFC] Deprecate boolean to string coercion
| From: | G. P. B. | Date: | Fri, 25 Jun 2021 13:11:06 +0000 |
| Subject: | Re: [RFC] Deprecate boolean to string coercion | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115141@lists.php.net to get a copy of this message | ||
On Tue, 22 Jun 2021 at 23:52, tyson andre <tysonandre775@hotmail.com> wrote:
> Hi George P. Banyard,
>
> > With Ilija we are proposing a short RFC to deprecate coercion from bool
> to
> > string:
> > https://wiki.php.net/rfc/deprecate-boolean-string-coercion
> >
> > As this is the final day for any RFC to be even able to land in PHP 8.1
> > the voting is expected to start in two weeks on the 6th of July.
> >
> > The implementation is yet to be done but is expected to be rather
> > straightforward and finished within the week.
>
> I'd agree any casts from booleans to strings are usually a bug in the
> application
>
> Something I'd like to see in the rfc: What's the intended behavior
> (notices) of
sprintf('%s', false); (functions
> internally casting to
> strings)
> What about echo true; print(false);, etc.
>
> Thanks,
> Tyson
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
Hello Tyson,
Thanks for pointing this out, we clarified this in the RFC now.
Moreover, seeing the impact on the tests of php-src we also propose to
change some function signatures to accept boolean arguments.
The only such function currently is ini_set(), but others might be added.
Best regards,
George P. Banyard