3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace ZarkielMedia; class Youtube{ private $videoMap = array( "13" => array("3GP", "Low Quality - 176x144"), "17" => array("3GP", "Medium Quality - 176x144"), "36" => array("3GP", "High Quality - 320x240"), "5" => array("FLV", "Low Quality - 400x226"), "6" => array("FLV", "Medium Quality - 640x360"), "34" => array("FLV", "Medium Quality - 640x360"), "35" => array("FLV", "High Quality - 854x480"), "43" => array("WEBM", "Low Quality - 640x360"), "44" => array("WEBM", "Medium Quality - 854x480"), "45" => array("WEBM", "High Quality - 1280x720"), "18" => array("MP4", "Medium Quality - 480x360"), "22" => array("MP4", "High Quality - 1280x720"), "37" => array("MP4", "High Quality - 1920x1080"), "38" => array("MP4", "High Quality - 4096x230") ); private $videoPageUrl = 'http://www.youtube.com/watch?v='; protected function getPageContent($id){ $page = $this->videoPageUrl.$id; $content = file_get_contents($page); return $content; } function getDownloadLinks($id){ $content = $this->getPageContent($id); $videos = array('MP4' => array(), 'FLV' => array(), '3GP' => array(), 'WEBM' => array()); if(preg_match('/"url_encoded_fmt_stream_map": "(.*)"/iUm', $content, $r)){ $data = $r[1]; $data = explode(',', $data); foreach($data As $cdata){ $cdata = str_replace('u0026', '&', $cdata); $cdata = explode('&', $cdata); foreach($cdata As $xdata){ if(preg_match('/^sig/', $xdata)){ $sig = substr($xdata, 4); } if(preg_match('/^url/', $xdata)){ $url = substr($xdata, 4); } if(preg_match('/^itag/', $xdata)){ $type = substr($xdata, 5); } } $url = urldecode($url).'&signature='.$sig; $videos[$this->videoMap[$type][0]][$this->videoMap[$type][1]] = $url; } } return $videos; } } $youtube = new ZarkielMediaYoutube(); $download_links = $youtube->getDownloadLinks('q_gfD3nvh-8'); print_r($download_links);

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.0070.01416.75
8.3.50.0120.00921.99
8.3.40.0120.00318.98
8.3.30.0090.00619.02
8.3.20.0000.00820.37
8.3.10.0000.00823.53
8.3.00.0050.00317.59
8.2.180.0130.00316.63
8.2.170.0110.00422.96
8.2.160.0120.00620.35
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00417.60
8.2.110.0090.00020.56
8.2.100.0090.00318.04
8.2.90.0040.00419.09
8.2.80.0080.00017.97
8.2.70.0030.00617.50
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0060.00321.19
8.2.30.0030.00320.65
8.2.20.0050.00317.64
8.2.10.0000.00817.95
8.2.00.0090.00017.90
8.1.280.0150.00425.92
8.1.270.0060.00323.79
8.1.260.0060.00326.35
8.1.250.0050.00228.09
8.1.240.0030.00619.21
8.1.230.0110.00017.66
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.01017.22
8.1.190.0040.00417.11
8.1.180.0050.00318.10
8.1.170.0070.00018.87
8.1.160.0040.00421.91
8.1.150.0060.00318.80
8.1.140.0030.00619.41
8.1.130.0070.00017.62
8.1.120.0000.00717.32
8.1.110.0040.00417.34
8.1.100.0050.00317.43
8.1.90.0040.00417.41
8.1.80.0050.00317.28
8.1.70.0000.00717.38
8.1.60.0080.00017.55
8.1.50.0050.00317.49
8.1.40.0040.00417.48
8.1.30.0040.00717.63
8.1.20.0030.00517.59
8.1.10.0000.00817.41
8.1.00.0040.00417.48
8.0.300.0040.00418.90
8.0.290.0040.00416.75
8.0.280.0030.00318.43
8.0.270.0040.00416.85
8.0.260.0000.00617.14
8.0.250.0040.00416.98
8.0.240.0040.00417.00
8.0.230.0000.00717.00
8.0.220.0040.00416.98
8.0.210.0000.00716.89
8.0.200.0060.00016.96
8.0.190.0040.00416.88
8.0.180.0020.00516.95
8.0.170.0030.00616.96
8.0.160.0060.00616.93
8.0.150.0050.00316.86
8.0.140.0000.00716.88
8.0.130.0030.00313.36
8.0.120.0060.00316.84
8.0.110.0050.00216.91
8.0.100.0030.00516.95
8.0.90.0000.00816.74
8.0.80.0120.00916.98
8.0.70.0040.00416.99
8.0.60.0040.00416.92
8.0.50.0030.00516.77
8.0.30.0070.01016.96
8.0.20.0090.00917.40
8.0.10.0040.00416.86
8.0.00.0080.00916.79
7.4.330.0050.00015.08
7.4.320.0000.00616.39
7.4.300.0040.00416.39
7.4.290.0000.00716.48
7.4.280.0080.00016.52
7.4.270.0030.00316.52
7.4.260.0070.00016.53
7.4.250.0000.00716.45
7.4.240.0030.00416.51
7.4.230.0040.00416.50
7.4.220.0070.01016.43
7.4.210.0090.01016.49
7.4.200.0090.00016.39
7.4.150.0130.00617.40
7.4.140.0060.01117.86
7.4.130.0070.01116.45
7.4.120.0100.01016.40
7.4.110.0130.01016.41
7.4.100.0050.01416.46
7.4.90.0070.01016.73
7.4.80.0000.01619.39
7.4.70.0070.01016.44
7.4.60.0100.00616.42
7.4.50.0050.00516.48
7.4.40.0090.00916.39
7.4.30.0060.01116.53
7.4.10.0090.00915.11
7.4.00.0050.01115.11
7.3.330.0020.00213.20
7.3.320.0050.00013.40
7.3.310.0070.00016.15
7.3.300.0070.00016.33
7.3.290.0050.00316.34
7.3.280.0120.00616.31
7.3.270.0030.01417.40
7.3.260.0030.01716.40
7.3.250.0060.01116.44
7.3.240.0080.01416.29
7.3.230.0120.01216.39
7.3.210.0110.00716.45
7.3.200.0060.01116.36
7.3.190.0060.01016.64
7.3.180.0130.00316.43
7.3.170.0090.01216.62
7.3.160.0060.01016.30
7.3.130.0110.00714.57
7.3.120.0100.01015.00
7.3.110.0080.00414.79
7.3.100.0040.01114.64
7.3.90.0040.01114.56
7.3.80.0060.00914.83
7.3.70.0030.01014.94
7.3.60.0030.01314.85
7.3.50.0000.01214.89
7.3.40.0040.00414.89
7.3.30.0090.00414.89
7.3.20.0080.00316.46
7.3.10.0100.00616.60
7.3.00.0060.00616.50
7.2.330.0130.00316.66
7.2.320.0060.01116.67
7.2.310.0130.00616.58
7.2.300.0090.01016.66
7.2.290.0070.01016.39
7.2.260.0100.00715.10
7.2.250.0040.01414.77
7.2.240.0000.01515.07
7.2.230.0100.00714.81
7.2.220.0000.01214.63
7.2.210.0030.01315.14
7.2.200.0090.00615.05
7.2.190.0100.00715.11
7.2.180.0080.00815.05
7.2.170.0130.00015.02
7.2.160.0000.01015.05
7.2.150.0070.00716.70
7.2.140.0030.00716.76
7.2.130.0070.01116.59
7.2.120.0000.01416.81
7.2.110.0030.01016.57
7.2.100.0030.00616.89
7.2.90.0120.00616.73
7.2.80.0030.00916.63
7.2.70.0060.00916.76
7.2.60.0050.01016.69
7.2.50.0030.01116.66
7.2.40.0060.00716.74
7.2.30.0040.00816.92
7.2.20.0030.01316.73
7.2.10.0070.00316.55
7.2.00.0090.00517.96
7.1.330.0070.00415.82
7.1.320.0060.00615.64
7.1.310.0040.01215.31
7.1.300.0030.01115.62
7.1.290.0040.00415.57
7.1.280.0030.00615.68
7.1.270.0070.01015.60
7.1.260.0080.00415.77
7.1.250.0030.01015.39
7.1.240.0030.01015.76
7.1.230.0030.00615.50
7.1.220.0030.00915.38
7.1.210.0060.01215.42
7.1.200.0030.01015.64
7.1.190.0040.01115.39
7.1.180.0030.00715.59
7.1.170.0110.00415.63
7.1.160.0000.01215.28
7.1.150.0000.01415.50
7.1.140.0040.01115.55
7.1.130.0080.00415.78
7.1.120.0070.00315.73
7.1.110.0070.00715.35
7.1.100.0060.01016.83
7.1.90.0000.01415.64
7.1.80.0030.01215.77
7.1.70.0040.00616.38
7.1.60.0040.00817.53
7.1.50.0070.00916.23
7.1.40.0030.00715.36
7.1.30.0060.00615.44
7.1.20.0000.01315.46
7.1.10.0070.00315.39
7.1.00.0030.04518.98
7.0.330.0060.00815.18
7.0.320.0000.00815.12
7.0.310.0070.00715.33
7.0.300.0090.00015.37
7.0.290.0070.00315.13
7.0.280.0030.00615.02
7.0.270.0110.00315.29
7.0.260.0090.00615.33
7.0.250.0030.00915.43
7.0.240.0000.01315.21
7.0.230.0070.00715.26
7.0.220.0060.00915.24
7.0.210.0040.00415.09
7.0.200.0200.00115.15
7.0.190.0040.01115.31
7.0.180.0080.00615.15
7.0.170.0050.00515.51
7.0.160.0110.00415.08
7.0.150.0070.01015.32
7.0.140.0030.01015.15
7.0.130.0070.00715.25
7.0.120.0100.00015.38
7.0.110.0070.00715.40
7.0.100.0150.00015.40
7.0.90.0070.00715.16
7.0.80.0070.00315.12
7.0.70.0000.01415.16
7.0.60.0120.04117.54
7.0.50.0070.04516.61
7.0.40.0030.02516.82
7.0.30.0130.02516.74
7.0.20.0180.02516.76
7.0.10.0060.02316.86
7.0.00.0030.05116.85
5.6.400.0040.01114.20
5.6.390.0070.00714.41
5.6.380.0090.00614.30
5.6.370.0100.00614.01
5.6.360.0040.01114.43
5.6.350.0040.01114.46
5.6.340.0080.00414.31
5.6.330.0040.00714.25
5.6.320.0060.00614.41
5.6.310.0030.01013.97
5.6.300.0060.00313.93
5.6.290.0000.01514.19
5.6.280.0020.03517.60
5.6.270.0030.01014.38
5.6.260.0070.00714.28
5.6.250.0060.01214.17
5.6.240.0060.00614.00
5.6.230.0030.01314.07
5.6.220.0000.01314.09
5.6.210.0030.03717.49
5.6.200.0100.03716.22
5.6.190.0040.04717.57
5.6.180.1120.02717.34
5.6.170.0230.02417.27
5.6.160.0030.03917.32
5.6.150.0010.02716.18
5.6.140.0080.04516.10
5.6.130.0030.04516.32
5.6.120.0080.02617.53
5.6.110.0060.04317.64
5.6.100.0020.02617.66
5.6.90.0080.04817.53
5.6.80.0080.02317.41
5.6.70.0030.00714.16
5.6.60.0100.00614.00
5.6.50.0060.00613.88
5.6.40.0030.00514.36
5.6.30.0110.00014.18
5.6.20.0080.00414.17
5.6.10.0080.00014.07
5.6.00.0000.01314.09
5.5.380.0040.00813.81
5.5.370.0070.00714.37
5.5.360.0030.00813.82
5.5.350.2000.02717.27
5.5.340.0050.04016.02
5.5.330.0100.02417.29
5.5.320.0120.04917.06
5.5.310.0070.02917.12
5.5.300.0070.03815.96
5.5.290.0020.02515.98
5.5.280.0100.02317.39
5.5.270.0080.04117.48
5.5.260.0050.04817.36
5.5.250.0120.03517.36
5.5.240.0090.03616.99
5.5.230.0100.00313.77
5.5.220.0070.01013.72
5.5.210.0110.00414.12
5.5.200.0040.00714.00
5.5.190.0000.01113.80
5.5.180.0060.00613.93
5.5.170.0060.00314.09
5.5.160.0120.00314.25
5.5.150.0070.00714.14
5.5.140.0050.00313.80
5.5.130.0090.00014.13
5.5.120.0060.00914.16
5.5.110.0080.00314.05
5.5.100.0040.01113.90
5.5.90.0040.01114.09
5.5.80.0040.00713.82
5.5.70.0030.01313.79
5.5.60.0130.00013.96
5.5.50.0130.00313.90
5.5.40.0030.00913.92
5.5.30.0030.01014.32
5.5.20.0060.00614.16
5.5.10.0100.00314.07
5.5.00.0030.00913.82
5.4.450.0300.03315.64
5.4.440.0340.03015.57
5.4.430.0360.02315.64
5.4.420.0310.03115.48
5.4.410.0320.03315.51
5.4.400.0330.02815.32
5.4.390.0320.03215.46
5.4.380.0300.03215.40
5.4.370.0350.02715.48
5.4.360.0330.02815.40
5.4.350.0280.03515.39
5.4.340.0310.03215.25
5.4.330.0090.00311.66
5.4.320.0330.03115.41
5.4.310.0330.02615.46
5.4.300.0270.03815.40
5.4.290.0290.02515.44
5.4.280.0280.02815.45
5.4.270.0270.02515.48
5.4.260.0320.02815.39
5.4.250.0350.02515.39
5.4.240.0340.03015.32
5.4.230.0330.03015.40
5.4.220.0380.02515.31
5.4.210.0330.02915.45
5.4.200.0250.03315.45
5.4.190.0320.03015.36
5.4.180.0110.03515.38
5.4.170.0120.03515.46
5.4.160.0210.02815.32
5.4.150.0340.03015.45
5.4.140.0240.02514.10
5.4.130.0270.02414.08
5.4.120.0320.02614.08
5.4.110.0260.03314.09
5.4.100.0230.03114.13
5.4.90.0180.03013.98
5.4.80.0000.03014.03
5.4.70.0030.03414.13
5.4.60.0220.03314.08
5.4.50.0330.02214.08
5.4.40.0020.03214.13
5.4.30.0080.02814.13
5.4.20.0130.03014.11
5.4.10.0230.02813.95
5.4.00.0300.03013.84

preferences:
53.56 ms | 401 KiB | 5 Q