3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $code = 'mdjVHcTHx04'; $data = file_get_contents('http://youtube.com/get_video_info?video_id=' . $code . '&el=vevo&fmt=18&asv=2&hd=1'); parse_str($data , $details); $my_formats_array = explode(',' , $details['adaptive_fmts']); $avail_formats[] = ''; $i = 0; $ipbits = $ip = $itag = $sig = $quality_label = ''; $expire = time(); $result[] = ''; foreach ($my_formats_array as $format) { parse_str($format); $result[$i]['quality'] = $quality_label; $type = explode(';', $type); $avail_formats[$i]['type'] = $type[0]; $avail_formats[$i]['url'] = urldecode($url); parse_str(urldecode($url)); $avail_formats[$i]['expires'] = date("G:i:s T", $expire); $avail_formats[$i]['ipbits'] = $ipbits; $avail_formats[$i]['ip'] = $ip; $time = get_duration($code); $size = get_video_size($quality_label,$time); $result[$i]['quality'] = $quality_label; $result[$i]['type'] = $type[0]; $result[$i]['size'] = $size; $result[$i]['url'] = urldecode($url); $i++; } echo json_encode($result); ?>
Output for 7.2.0 - 7.2.6
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/k5f9u on line 15 Warning: Illegal string offset 'quality' in /in/k5f9u on line 16 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 16 Notice: Undefined variable: type in /in/k5f9u on line 17 Warning: Illegal string offset 'type' in /in/k5f9u on line 18 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 18 Notice: Undefined variable: url in /in/k5f9u on line 19 Warning: Illegal string offset 'url' in /in/k5f9u on line 19 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/k5f9u on line 20 Warning: Illegal string offset 'expires' in /in/k5f9u on line 21 Warning: Illegal string offset 'ipbits' in /in/k5f9u on line 22 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 22 Warning: Illegal string offset 'ip' in /in/k5f9u on line 23 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 23 Fatal error: Uncaught Error: Call to undefined function get_duration() in /in/k5f9u:25 Stack trace: #0 {main} thrown in /in/k5f9u on line 25
Process exited with code 255.
Output for 7.1.0 - 7.1.20
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Warning: Illegal string offset 'quality' in /in/k5f9u on line 16 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 16 Notice: Undefined variable: type in /in/k5f9u on line 17 Warning: Illegal string offset 'type' in /in/k5f9u on line 18 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 18 Notice: Undefined variable: url in /in/k5f9u on line 19 Warning: Illegal string offset 'url' in /in/k5f9u on line 19 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Warning: Illegal string offset 'expires' in /in/k5f9u on line 21 Warning: Illegal string offset 'ipbits' in /in/k5f9u on line 22 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 22 Warning: Illegal string offset 'ip' in /in/k5f9u on line 23 Warning: Cannot assign an empty string to a string offset in /in/k5f9u on line 23 Fatal error: Uncaught Error: Call to undefined function get_duration() in /in/k5f9u:25 Stack trace: #0 {main} thrown in /in/k5f9u on line 25
Process exited with code 255.
Output for 7.0.13 - 7.0.29
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Uncaught Error: Call to undefined function get_duration() in /in/k5f9u:25 Stack trace: #0 {main} thrown in /in/k5f9u on line 25
Process exited with code 255.
Output for 7.0.0 - 7.0.12
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Uncaught Error: Call to undefined function get_duration() in /in/k5f9u:25 Stack trace: #0 {main} thrown in /in/k5f9u on line 25
Process exited with code 255.
Output for hhvm-3.22.0
Warning: Failed to open http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1 (Could not resolve host: youtube.com) in /in/k5f9u on line -1 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line -1 Notice: Undefined variable: type in /in/k5f9u on line -1 Notice: Undefined variable: url in /in/k5f9u on line -1 Notice: Undefined variable: url in /in/k5f9u on line -1 Fatal error: Uncaught Error: Call to undefined function get_duration() in /in/k5f9u:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.20.2 - 3.21.3
Warning: Failed to open http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1 (Could not resolve host: youtube.com) in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Uncaught Error: Call to undefined function get_duration() in /in/k5f9u:25 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.19.2
Warning: Failed to open http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1 (Could not resolve host: youtube.com) in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Warning: explode() expects parameter 2 to be string, null given in /in/k5f9u on line 7 Warning: Invalid argument supplied for foreach() in /in/k5f9u on line 34 [""]
Output for hhvm-3.10.1
Warning: Failed to open http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1 (Could not resolve host: youtube.com) in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.3.0 - 5.5.38, 5.6.27 - 5.6.30
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.6.0 - 5.6.26
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.2.6 - 5.2.17
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.0.4 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Connection refused in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.0.3
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Connection refused in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Resource temporarily unavailable in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Bad file descriptor in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Connection refused in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function: get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.4
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Connection refused in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function: get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 4.3.5 - 4.3.9
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Resource temporarily unavailable in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function: get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 4.3.2
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1): failed to open stream: Connection refused in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function: get_duration() in /in/k5f9u on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: System error in /in/k5f9u on line 4 Warning: file_get_contents(http://youtube.com/get_video_info?video_id=mdjVHcTHx04&el=vevo&fmt=18&asv=2&hd=1) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/k5f9u on line 4 Notice: Undefined index: adaptive_fmts in /in/k5f9u on line 7 Notice: Undefined variable: type in /in/k5f9u on line 17 Notice: Undefined variable: url in /in/k5f9u on line 19 Notice: Undefined variable: url in /in/k5f9u on line 20 Fatal error: Call to undefined function: get_duration() in /in/k5f9u on line 25