scandir restituisce già un array, che problema c'è dunque?

$files = scandir($directory);
print count($files);