3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ERROR); $resolution[22]='720_mp4'; $resolution[18]='360_mp4'; $resolution[43]='360_webm'; $resolution[5]='240p_flv'; $resolution[36]='240p_3gp'; $resolution[17]='114p_3gp'; $data = 'http://www.youtube.com/watch?v=u7R4kdCi1zY'; //$data = file_get_contents($_GET['url']); preg_match('/ytplayer.config = {(.*?)};/',$data,$match); //debug($match); $o = json_decode('{'.$match[1].'}') ; $links = explode(',',$o -> args -> url_encoded_fmt_stream_map); //print_r ($links); foreach($links as $link) { parse_str($link,$r); //echo $link." - ".$r."<br />"; print_r ($r); //debug($r); /* if ($r['s']) { echo ('<a href="/domain.com/play.php?token='. urlencode($r['url']."&signature=".decrypt_sig($r['s'],'fr_FR-vflmo6Hkk/html5player')).'&fn=video.mp4">quality: '.$resolution[$r['itag']].'</a><br />'); } else { //$linkr = preg_replace("/googlevideo.com/","c.docs.google.com",$r['url']); //$link = preg_replace("/http:/","https:",$linkr); echo '<a href="'.$r['url'].'">quality: '.$resolution[$r['itag']].'</a><br />'; } */ //echo '<div>'.$r['s'].'</div>'; } function decrypt_sig($s,$player_id) { /* Methods / Commands for decrypting sig. - r = reverse the string; - sN = slice from character N to the end; - wN = swap 0th and Nth character. */ $algo = array( 'fr_FR-vflmo6Hkk/html5player' => 'w8 s3 w45 w46 s2 w29 w25 w56 w2', // 26 sep 2014, ); $method = explode(" ",$algo[$player_id]); foreach($method as $m) { if($m == 'r') $s = strrev($s); else if( substr($m,0,1) == 's') $s = substr($s, (int) substr($m,1) ); else if( substr($m,0,1) == 'w') $s = swap($s, (int) substr($m,1)); //echo $m." - ".$s."<br />"; } return $s; } function swap($a, $b) { $c = $a[0]; $a[0] = $a[$b]; $a[$b] = $c; return $a; } function getpage($url) { // fetch data $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $data = curl_exec($curl); curl_close($curl); return $data; } function debug($str) { if(is_array($str) || is_object($str)) { print '<pre>'; print_r($str); print '</pre>'; } else echo $str; } //echo '<div>'.htmlspecialchars($data).'</div>'; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0120.00918.56
8.3.50.0060.01218.00
8.3.40.0060.00919.21
8.3.30.0070.00719.16
8.3.20.0040.00420.16
8.3.10.0050.00320.77
8.3.00.0100.00718.05
8.2.180.0160.00325.92
8.2.170.0180.00419.25
8.2.160.0070.00720.34
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0000.00822.24
8.2.110.0060.00322.15
8.2.100.0080.00419.23
8.2.90.0040.00418.00
8.2.80.0080.00417.97
8.2.70.0040.00418.05
8.2.60.0030.00618.16
8.2.50.0060.00317.75
8.2.40.0060.00319.73
8.2.30.0050.00518.07
8.2.20.0030.00618.05
8.2.10.0030.00619.81
8.2.00.0050.00218.06
8.1.280.0150.00025.92
8.1.270.0030.00623.91
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.01122.14
8.1.230.0040.00819.35
8.1.220.0030.00517.79
8.1.210.0030.00518.77
8.1.200.0030.00617.60
8.1.190.0030.00517.60
8.1.180.0040.00418.10
8.1.170.0000.00718.96
8.1.160.0040.00418.87
8.1.150.0040.00418.88
8.1.140.0020.00517.69
8.1.130.0030.00317.89
8.1.120.0000.00817.55
8.1.110.0020.00517.53
8.1.100.0050.00217.63
8.1.90.0000.00717.71
8.1.80.0040.00417.59
8.1.70.0070.00017.53
8.1.60.0060.00317.79
8.1.50.0000.00817.72
8.1.40.0070.00017.71
8.1.30.0050.00317.79
8.1.20.0060.00317.89
8.1.10.0000.00817.77
8.1.00.0040.00417.59
8.0.300.0000.00719.89
8.0.290.0040.00416.88
8.0.280.0000.00718.51
8.0.270.0000.00817.09
8.0.260.0000.00717.24
8.0.250.0000.00717.16
8.0.240.0000.00717.20
8.0.230.0040.00417.20
8.0.220.0000.00717.14
8.0.210.0000.00717.10
8.0.200.0030.00317.18
8.0.190.0070.00017.20
8.0.180.0040.00417.16
8.0.170.0080.00017.18
8.0.160.0000.00817.14
8.0.150.0040.00417.03
8.0.140.0050.00317.07
8.0.130.0030.00313.64
8.0.120.0040.00417.08
8.0.110.0070.00017.10
8.0.100.0000.00717.25
8.0.90.0000.00717.21
8.0.80.0120.00917.10
8.0.70.0000.00816.95
8.0.60.0040.00417.00
8.0.50.0080.00017.10
8.0.30.0110.00917.16
8.0.20.0140.00917.48
8.0.10.0040.00417.15
8.0.00.0060.01217.20
7.4.330.0000.00515.10
7.4.320.0030.00316.79
7.4.300.0030.00316.68
7.4.290.0040.00416.78
7.4.280.0000.00716.89
7.4.270.0030.00316.86
7.4.260.0030.00316.84
7.4.250.0040.00416.74
7.4.240.0010.00616.80
7.4.230.0030.00316.86
7.4.220.0060.01216.73
7.4.210.0070.01316.80
7.4.200.0040.00416.51
7.4.160.0130.00716.76
7.4.150.0080.01117.40
7.4.140.0090.00917.86
7.4.130.0100.00916.83
7.4.120.0070.01216.81
7.4.110.0080.00816.75
7.4.100.0090.00916.71
7.4.90.0120.00616.91
7.4.80.0080.01616.89
7.4.70.0130.00416.64
7.4.60.0140.00316.86
7.4.50.0060.00316.79
7.4.40.0090.00816.87
7.4.30.0080.00816.59
7.4.00.0080.00015.14
7.3.330.0030.00213.63
7.3.320.0050.00013.43
7.3.310.0030.00416.66
7.3.300.0000.00716.56
7.3.290.0140.00916.55
7.3.280.0080.00716.60
7.3.270.0120.01217.40
7.3.260.0070.01016.63
7.3.250.0080.00916.56
7.3.240.0080.00816.54
7.3.230.0090.00916.67
7.3.210.0040.01516.57
7.3.200.0110.00719.39
7.3.190.0070.01416.72
7.3.180.0040.01416.56
7.3.170.0130.00916.70
7.3.160.0110.00716.64
7.2.330.0190.00016.92
7.2.320.0060.01117.03
7.2.310.0090.00917.11
7.2.300.0090.00916.93
7.2.290.0100.00616.97
7.2.60.0070.00717.02
7.2.00.0000.01319.52
7.1.200.0030.00715.97
7.1.100.0000.00918.34
7.1.70.0030.00517.49
7.1.60.0090.01619.32
7.1.50.0060.01617.01
7.1.00.0030.07722.29
7.0.200.0040.00417.06
7.0.140.0100.06021.94
7.0.60.0130.05720.12
7.0.50.0130.08318.03
7.0.40.0030.05320.27
7.0.30.0330.07320.32
7.0.20.0330.06020.13
7.0.10.0100.08320.08
7.0.00.0070.05020.46
5.6.280.0000.07320.78
5.6.210.0030.04320.71
5.6.200.0000.08018.25
5.6.190.0070.04020.55
5.6.180.4100.03720.39
5.6.170.0270.07720.56
5.6.160.0030.08720.55
5.6.150.0000.04318.18
5.6.140.0070.04718.21
5.6.130.0070.05718.18
5.6.120.0130.04021.01
5.6.110.0000.09321.03
5.6.100.0130.08021.05
5.6.90.0030.04321.02
5.6.80.0000.08320.45
5.6.70.4130.03020.51
5.5.350.0030.08020.34
5.5.340.0130.06018.08
5.5.330.0070.08320.47
5.5.320.0170.06020.27
5.5.310.0170.04720.42
5.5.300.0170.07017.96
5.5.290.0030.06018.04
5.5.280.0070.05020.89
5.5.270.0030.09320.69
5.5.260.0270.06320.86
5.5.250.0070.08020.70
5.5.240.0230.06720.27
5.4.450.0230.05019.42
5.4.440.0300.05319.55
5.4.430.0230.06019.31
5.4.420.0200.03719.31
5.4.410.0200.07319.28
5.4.400.0270.06019.22
5.4.390.0100.05719.23
5.4.380.0200.05319.21
5.4.370.0200.05018.95
5.4.360.0330.06719.24
5.4.350.0330.06018.99
5.4.340.0230.07719.09
5.4.320.0270.03018.98
5.4.310.0230.04019.22
5.4.300.0200.07319.16
5.4.290.0200.08019.21
5.4.280.0230.08019.14
5.4.270.0200.08019.15
5.4.260.0230.07718.94
5.4.250.0270.07319.16
5.4.240.0330.06319.08
5.4.230.0200.07318.95
5.4.220.0130.05318.84
5.4.210.0200.04318.99
5.4.200.0070.04319.30
5.4.190.0130.05019.20
5.4.180.0130.04319.13
5.4.170.0170.03719.12
5.4.160.0300.05019.22
5.4.150.0130.03718.83
5.4.140.0130.04016.42
5.4.130.0070.04316.56
5.4.120.0130.03316.50
5.4.110.0130.04016.59
5.4.100.0070.04016.51
5.4.90.0130.03716.61
5.4.80.0400.03716.58
5.4.70.0130.03316.59
5.4.60.0100.04316.34
5.4.50.0170.04016.52
5.4.40.0200.03016.49
5.4.30.0070.04016.56
5.4.20.0170.03016.37
5.4.10.0130.04016.54
5.4.00.0200.03715.80
5.3.290.0130.04714.84
5.3.280.0230.04014.62
5.3.270.0100.04014.60
5.3.260.0170.03314.67
5.3.250.0100.04014.54
5.3.240.0100.04014.68
5.3.230.0130.03714.84
5.3.220.0170.03714.56
5.3.210.0130.03714.68
5.3.200.0170.03314.51
5.3.190.0200.03014.70
5.3.180.0200.03014.70
5.3.170.0400.04314.80
5.3.160.0130.03714.66
5.3.150.0400.04314.70
5.3.140.0130.03714.80
5.3.130.0130.03714.62
5.3.120.0200.03314.72
5.3.110.0130.03714.57
5.3.100.0170.03313.98
5.3.90.0200.03014.03
5.3.80.0170.04014.09
5.3.70.0130.04014.05
5.3.60.0130.03713.93
5.3.50.0130.03713.88
5.3.40.0200.04314.14
5.3.30.0200.03313.84
5.3.20.0230.07013.80
5.3.10.0330.05013.68
5.3.00.0300.06713.90
5.2.170.0100.04012.43
5.2.160.0200.05012.43
5.2.150.0130.03012.43
5.2.140.0170.02712.43
5.2.130.0200.06012.43
5.2.120.0170.04712.43
5.2.110.0200.05712.43
5.2.100.0200.04712.43
5.2.90.0200.04712.43
5.2.80.0230.06312.43
5.2.70.0200.04712.43
5.2.60.0200.06012.43
5.2.50.0170.03712.43
5.2.40.0170.05712.43
5.2.30.0170.04012.43
5.2.20.0200.05312.43
5.2.10.0130.03712.43
5.2.00.0200.04012.43
5.1.60.0130.03012.43
5.1.50.0230.03312.43
5.1.40.0130.05312.43
5.1.30.0170.03712.43
5.1.20.0100.04712.43
5.1.10.0130.05712.43
5.1.00.0170.05012.43
5.0.50.0070.04312.43
5.0.40.0070.02012.43
5.0.30.0030.04712.43
5.0.20.0070.04012.43
5.0.10.0130.02712.43
5.0.00.0170.05712.43
4.4.90.0170.03012.43
4.4.80.0100.03012.43
4.4.70.0070.02012.43
4.4.60.0030.02312.43
4.4.50.0070.02312.43
4.4.40.0100.02712.43
4.4.30.0100.02012.43
4.4.20.0100.03712.43
4.4.10.0100.03712.43
4.4.00.0070.03312.43
4.3.110.0100.01312.43
4.3.100.0070.03712.43
4.3.90.0070.03312.43
4.3.80.0070.03712.43
4.3.70.0070.02012.43
4.3.60.0100.02712.43
4.3.50.0100.02312.43
4.3.40.0070.04012.43
4.3.30.0070.03312.43
4.3.20.0000.03012.43
4.3.10.0030.02312.43
4.3.00.0030.02312.43

preferences:
58.37 ms | 400 KiB | 5 Q