On Wed, 23 Feb 2022 at 14:00, Guilliam Xavier <guilliam.xav...@gmail.com> wrote:
> On Tue, Feb 22, 2022 at 3:59 AM Alexandru Pătrănescu <dreal...@gmail.com> > wrote: > > But when types are not considered important I think it's worth pursuing > > extending the coercion from null to the 4 other types where it's > happening > > right now: > > - int as 0, > > - float as 0.0, > > - string as an empty string > > - bool as false. > > > > Indeed, that could also be a way to solve the original (PHP 7.0) > inconsistency between internal and user-defined functions > (although PHP 8.1 started to take the opposite route...) > Yep, I'm hoping to find a solution that keeps as many people happy as possible, and improves the language. Personally I think `strict_types=1` is fine for my code, but I would never want to force that style on everyone, because doing so would be fairly hostile for a language that's popular and well known for being easy to use/learn. And for those who like strict environments, I'm always interested in what `Content-Security-Policy` they use, because that's a really useful form of strict coding, especially when using `default-src 'none'; script-src https://static.example.com; require-trusted-types-for 'script'; trusted-types 'none';` and `Content-Type: application/xhtml+xml; charset=UTF-8` to ensure quoted attributes :-) Craig