@Ibolac; İşlemi bi' fonksiyona alıp boş dönerse tekrardan yapılmasını sağlayabilirsin.
<?php
$first = true;
$test = array();
function test()
{
global $first, $test;
if(!$first)
{
$test = array(1, 2, 3);
}
else
{
$first = false;
}
return $test;
}
$count = count(test());
echo $count; // 0
$count = count(test());
echo $count; // 3