PHP Empty array considered falsy

Empty arrays in PHP are falsy.

$ php -r 'var_dump((bool)array());'
bool(false)
https://secure.php.net/manual/en/types.comparisons.php
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment