Girgias / php-rfc-bool-string-deprecation

PHP RFC to deprecate boolean to string coercion
1 stars 1 forks source link

Also deprecate printf #2

Closed iluuu1994 closed 1 year ago

iluuu1994 commented 3 years ago

I actually now thing we should deprecate absolutely all implicit coercion of bool to string, this includes printf. printf uses the same function for coercion as the rest of the engine so it does trigger a deprecation. We can manually exclude printf and other functions but it makes me think where we should stop. Ultimately, I think using bools in printf has the same issues as everywhere else.

Let me know what you think.

Girgias commented 3 years ago

I was thinking of doing this for float to int, but Nikita was against it because these functions perform "explicit" casts, and should follow that behaviour.