Re:Whats New in PHP 8.2
by cestith on Monday April 25, 2022 @11:01AM
(#31155828)
It would not surprise me any to have a Boolean type and have both true and false as restricted subtypes of that. However, in this case of it being used primarily as a return type for failure in a function call, I think they're conflating the tradition from C-style languages of returning a false-ish value in-bound rather than creating a type specific to the error condition.
[ Parent
| on HN ]
> I think they're conflating the tradition from C-style languages of returning a false-ish value in-bound
Itβs not really conflation when php has been doing that since forever as it originally was little more than a thin shim over C (you can see that in lots of older APIs e.g. the mysql_ stuff is straight transcribed from the C library).