PHP Gotchas

PHP is rife with oddities that can trip you up. I’m going to start keeping track of them here.

‘false’ is true

PHP casts ‘false’ to true.

echo (bool)false  1

Other lists

There are many sites on the web that collect them. Here are a couple:

Last modified: 19/02/2013 Tags:

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top