What is the difference between SPL iterator and this
The iterator class works perfectly, exact same result - with less looping needed. Is your iterator code faster or just elegant? I chose to replace with it as the code looks a lot cleaner but its a long routine compared to the code posted ^
if (isset($info['files']) || $filecount > 1)
{
if (isset($info['files']) && is_array($info['files']))
{
$torrentInfo['files'] = $info['files'];
foreach ($info['files'] as $file)
{
$filecount = ++$filecount;
$torrentsize += $file['length'];
}
$torrentInfo['length'] = $torrentsize;
$torrentInfo['ttfilecount'] = !empty($path) ? count($path) : $filecount;
}
}
The iterator class works perfectly, exact same result - with less looping needed. Is your iterator code faster or just elegant? I chose to replace with it as the code looks a lot cleaner but its a long routine compared to the code posted ^

