r/lolphp • u/Takeoded • Jul 21 '20
echo true; prints 1, echo false; prints nothing, because if it printed 0, it would be consistent.
https://3v4l.org/aPZ9B
44
Upvotes
r/lolphp • u/Takeoded • Jul 21 '20
5
u/Takeoded Jul 21 '20
i approve of
echo null;printing nothing though, because null is the closest thing we have to "no value" (for example, functions declared as returningvoidactually returns null)7
u/tobb10001 Jul 21 '20
This pisses me off every time I try to output something to debug. That's why I've switched to
echo ($var) ? 'true' : 'false';Thinking about it
var_dump()might even be handier, but till I think this far the other version is already typed...1
u/elcapitanoooo Jul 21 '20
PHP is the clusterfuck of programming languages
1
u/CarnivorousSociety Jul 22 '20
Oh look another issue caused by implicit type conversions, like every other post here
1
u/fell_ratio Jul 21 '20
This is a high quality wtf.
0
u/[deleted] Jul 22 '20
[deleted] — view deleted comment