3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total_seconds = 0; $dom = new DOMDocument(); $dom->loadXML(file_get_contents('http://gdata.youtube.com/feeds/api/playlists/PLZlv_N0_O1gaCL2XjKluO7N2Pmmw9pvhE')); $xpath = new DOMXPath($dom); foreach ($xpath->query('//yt:duration/@seconds') as $duration) { $total_seconds += (int) $duration->value; } echo (int) ($total_seconds / 3600) . ':' . (int) ($total_seconds / 60) % 60 . ':' . $total_seconds % 60;

preferences:
49.14 ms | 405 KiB | 6 Q