On Wed, Sep 17, 2008 at 9:09 AM, Tim Starling <tstarling(a)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.
!count( $array ) is also something like 40 times faster than !( $array
), apparently.
--
Stephen Bain
stephen.bain(a)gmail.com