I was under the (possibly mistaken) impression that if you check an array using empty() it will never be empty, however, this script reports that the array is not empty:
$tmp = array();
if (empty($tmp)) {
echo 'shiver me timbers! it *is* empty!';
} else {
echo 'i told you so! na na na na na na!';
}
I tested this on a php5 server. Is there a difference in how empty works on php4 and php5??
More importantly, is it considered the correct way to see if an array has any elements or not?