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.
Note that the second example (using `count()`) is significantly slower, by at least 50% on my system (over 10000 iterations). `count()` actually counts the elements of an array. I'm not positive, but I imagine casting an array to a boolean works much like `empty()`, and stops as soon as it finds at least one element.