Re: [RFC] Deprecate lossy conversions to and from bool

From: Date: Sun, 29 Nov 2026 23:48:04 +0000
Subject: Re: [RFC] Deprecate lossy conversions to and from bool
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-133260@lists.php.net to get a copy of this message
I am all for this, but I know a lot of people both on internals and externally who would rather defend PHP supporting bad code because of the amount of code out there which already is. But anything which is hardening the language is a win in my book. I do wonder though if when a function is type htined, it should be strict to that type. In your example of `function setEnabled(bool $enabled): void {}` I would honestly expect '0' or '1' to throw a type error.

« previous php.internals (#133260) next »