3v4l.org

run code in 300+ PHP versions simultaneously
<?php $debug = true; $id = 'crl_Z6uwups'; $type = 'mp4'; $url = 'http://youtube.com/get_video_info?video_id='; $key = 'url_encoded_fmt_stream_map'; $content = file_get_contents($url.$id); parse_str($content, $result); /*if($debug) { echo $url.$id.'<br/>'; echo $key.'<br/>'; echo $type.'<br/>'; echo '<pre>'; print_r($result); echo '</pre>'; } else { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="videofile.'.$type.'"'); } */ $type = 'type=video/'.$type; $files = explode(',url=', $result[$key]); $files[0] = substr($files[0], 4); for($i=0; $i<count($files); $i++) { $file = urldecode($files[$i]); $found = strpos($file, $type) > -1; if ($found){ echo '<a href="'.$file.'">'.$file.'</a><br/><br/>'; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for youtube.com failed: System error in /in/qiKaR on line 10 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=crl_Z6uwups): Failed to open stream: php_network_getaddresses: getaddrinfo for youtube.com failed: System error in /in/qiKaR on line 10 Warning: Undefined array key "url_encoded_fmt_stream_map" in /in/qiKaR on line 29 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/qiKaR on line 29

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
53.71 ms | 402 KiB | 8 Q