On Tue, Sep 16, 2008 at 7:09 PM, Tim Starling tstarling@wikimedia.org wrote:
No, it does the same thing as the "!" operator, except it also suppresses warnings. If you want to check if an array has zero length, you should just use "!", as I did in that commit, so that a typo in the variable name will still give you the appropriate warning. Or if you want to make it explicit that you are checking array length, you can use !count($array). empty() should only be used when you are sure you want to ignore warnings.
In particular, "!empty( $foo )" can be a handy shortcut for "isset( $foo ) && $foo".