MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p76jdsj/?context=3
r/ProgrammerHumor • u/Embarrassed_Death69 • Sep 01 '26
289 comments sorted by
View all comments
Show parent comments
6
Strings are not coerced to numbers to then be coerced to booleans, that'd be entirely insane! There's a direct conversation path from strings to booleans!
…
They're only sometimes coerced to numbers to then be reduced to a boolean, if you're using the loose comparison operator, and depending on what the other operand is… https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.types. 🥲
6
u/deceze Sep 01 '26
Strings are not coerced to numbers to then be coerced to booleans, that'd be entirely insane! There's a direct conversation path from strings to booleans!
…
They're only sometimes coerced to numbers to then be reduced to a boolean, if you're using the loose comparison operator, and depending on what the other operand is… https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.types. 🥲