In PHP, will these always return the same values?

```
//example 1

$array = array();

if ($array) {
   echo 'the array has items';

}

// example 2

$array = array();

if (count($array)) {
   echo 'the array has items';

}

```

Thank you!
['https://Stackoverflow.com/questions/552323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/31671/']
Those will always return the same value, but I find

```
$array = array();

if (empty($array)) {
   echo 'the array is empty';
}

```

to be a lot more readable.
Indeed they will. Converting an array to a bool will give you true if it is non-empty, and the count of an array is true with more than one element.

See also: <http://ca2.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting>