3v4l.org

run code in 300+ PHP versions simultaneously
<?php /***************************************************************** Created : 2014/03/25 Author : Mr. Khwanchai Kaewyos (LookHin) E-mail : khwanchai@gmail.com Website : www.LookHin.com Blog : www.unzeen.com Copyright (C) 2014, www.LookHin.com all rights reserved. *****************************************************************/ set_time_limit(0); $strMp4Folder = "./mp4/"; $strYoutubeDownloadUrl = " http://youtu.be/z-FNiOs_748 https://www.youtube.com/watch?v=gwKBOnMmpvU https://www.youtube.com/watch?v=dh7GMmRsQvA "; $arrYoutubeId = explode("\n", trim($strYoutubeDownloadUrl)); foreach ($arrYoutubeId as $key => $value) { // Get Youtube ID preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $value, $matches); $strYoutubeId = trim($matches[1]); print "Download => {$strYoutubeId}\n"; // Get Title Name $json = json_decode(file_get_contents("http://gdata.youtube.com/feeds/api/videos/{$strYoutubeId}?v=2&alt=json"),true); $strTitleName = iconv("UTF-8", "TIS-620", preg_replace("/[\"'\/:|\\\?\$\*%\-\+ ]/", "-", $json['entry']['title']['$t'])); // Get Mp4 Link $strMp4LinkTmp = ""; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER,1); curl_setopt($ch, CURLOPT_URL,"http://www.youtube.com/watch?v={$strYoutubeId}"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"); curl_setopt($ch, CURLOPT_REFERER, "http://www.youtube.com/watch?v={$strYoutubeId}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch); //print $result; preg_match_all("|url_encoded_fmt_stream_map\"\: \"(.*)\"|U",$result,$out, PREG_PATTERN_ORDER); $arrUrl = explode(',',$out[1][0]); foreach($arrUrl as $url){ if(substr_count(urldecode($url), "type=video/mp4") > 0 && substr_count(urldecode($url), "quality=medium") > 0){ $arrTmp = explode("\\u0026",urldecode($url)); $strUrl = ""; $strSig = ""; foreach($arrTmp as $strTmp){ if(substr_count(urldecode($strTmp), "url=") > 0){ $tmp = explode('url=',$strTmp); $strUrl = $tmp[1]; } if(substr_count(urldecode($strTmp), "sig=") > 0){ $tmp = explode('sig=',$strTmp); $strSig = $tmp[1]; } } $strMp4LinkTmp = $strUrl."&signature=".$strSig; //print $strMp4LinkTmp; } } // Download if($strMp4LinkTmp != ""){ //print $strMp4LinkTmp; copy($strMp4LinkTmp,"{$strMp4Folder}{$strTitleName}.mp4"); } } print "\n\nDownload Complete\n\n"; ?>

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.0180.00417.38
8.3.50.0120.00918.43
8.3.40.0060.00919.36
8.3.30.0040.01119.28
8.3.20.0050.00320.84
8.3.10.0060.00619.57
8.3.00.0080.00023.73
8.2.180.0110.00717.12
8.2.170.0090.00622.96
8.2.160.0140.00022.36
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0000.00821.13
8.2.120.0080.00026.35
8.2.110.0060.00321.30
8.2.100.0060.00618.30
8.2.90.0050.00319.59
8.2.80.0030.00518.09
8.2.70.0030.00718.25
8.2.60.0050.00518.43
8.2.50.0000.00918.13
8.2.40.0000.00922.50
8.2.30.0050.00519.73
8.2.20.0060.00318.30
8.2.10.0040.00418.43
8.2.00.0040.00418.37
8.1.280.0090.00625.92
8.1.270.0060.00322.36
8.1.260.0000.00828.09
8.1.250.0080.00028.09
8.1.240.0040.00724.08
8.1.230.0090.00318.14
8.1.220.0040.00418.02
8.1.210.0030.00518.77
8.1.200.0070.00317.63
8.1.190.0080.00017.63
8.1.180.0040.00418.10
8.1.170.0080.00418.95
8.1.160.0050.00321.05
8.1.150.0030.00621.00
8.1.140.0040.00419.88
8.1.130.0040.00418.05
8.1.120.0050.00217.90
8.1.110.0000.00718.00
8.1.100.0000.00817.81
8.1.90.0030.00517.89
8.1.80.0000.00817.86
8.1.70.0050.00318.00
8.1.60.0030.00618.03
8.1.50.0060.00317.89
8.1.40.0090.00018.04
8.1.30.0040.00418.00
8.1.20.0000.00817.86
8.1.10.0030.00618.10
8.1.00.0050.00317.80
8.0.300.0050.00318.77
8.0.290.0080.00017.13
8.0.280.0000.00718.82
8.0.270.0040.00417.57
8.0.260.0000.00817.64
8.0.250.0000.00717.42
8.0.240.0000.00817.54
8.0.230.0000.00717.39
8.0.220.0040.00417.33
8.0.210.0030.00517.39
8.0.200.0000.00817.42
8.0.190.0030.00517.45
8.0.180.0040.00417.43
8.0.170.0040.00417.50
8.0.160.0080.00017.42
8.0.150.0000.00817.43
8.0.140.0040.00417.31
8.0.130.0060.00013.92
8.0.120.0000.01117.64
8.0.110.0060.00317.67
8.0.100.0030.00617.61
8.0.90.0090.00017.56
8.0.80.0140.00317.65
8.0.70.0060.00317.65
8.0.60.0030.00617.54
8.0.50.0090.00017.70
8.0.30.0130.00817.62
8.0.20.0100.01317.75
8.0.10.0050.00517.61
8.0.00.0130.00917.35
7.4.330.0000.00517.11
7.4.320.0040.00417.03
7.4.300.0030.00316.84
7.4.290.0060.00317.02
7.4.280.0080.00016.96
7.4.270.0040.00417.11
7.4.260.0040.00416.92
7.4.250.0000.00917.18
7.4.240.0000.01017.25
7.4.230.0060.00317.17
7.4.220.0130.02017.27
7.4.210.0100.01417.20
7.4.200.0040.00417.29
7.4.160.0130.01317.01
7.4.150.0190.01017.44
7.4.140.0100.01517.86
7.4.130.0070.01517.31
7.4.120.0070.01517.21
7.4.110.0120.00917.17
7.4.100.0180.01117.05
7.4.90.0090.01517.10
7.4.80.0060.01519.39
7.4.70.0130.01117.13
7.4.60.0100.01117.16
7.4.50.0090.01317.09
7.4.40.0080.01216.93
7.4.30.0150.01516.95
7.4.20.0090.01217.05
7.4.10.0050.01816.32
7.4.00.0100.01215.98
7.3.330.0040.00413.73
7.3.320.0000.00613.92
7.3.310.0030.00716.96
7.3.300.0000.00917.09
7.3.290.0000.00917.04
7.3.280.0120.01017.11
7.3.270.0140.01017.47
7.3.260.0110.01417.06
7.3.250.0110.01517.08
7.3.240.0110.01317.06
7.3.230.0140.00617.19
7.3.210.0180.00717.14
7.3.200.0090.01217.18
7.3.190.0140.00617.11
7.3.180.0130.01017.06
7.3.170.0150.00917.10
7.3.160.0120.01517.08
7.3.150.0140.00916.94
7.3.140.0110.01117.13
7.3.130.0130.00816.20
7.3.120.0090.01416.31
7.3.110.0120.00916.37
7.3.100.0100.01116.20
7.3.90.0090.01216.28
7.3.80.0140.00816.35
7.3.70.0080.01116.16
7.3.60.0100.01216.34
7.3.50.0090.01316.29
7.3.40.0070.01016.29
7.3.30.0100.01016.19
7.3.20.0140.00717.16
7.3.10.0110.01317.24
7.3.00.0100.00617.21
7.2.330.0060.01717.39
7.2.320.0150.01117.39
7.2.310.0080.01417.35
7.2.300.0060.01417.31
7.2.290.0120.01117.30
7.2.280.0110.01117.28
7.2.270.0120.01217.32
7.2.260.0150.01216.55
7.2.250.0090.01416.72
7.2.240.0050.01316.53
7.2.230.0090.01016.55
7.2.220.0150.00616.36
7.2.210.0110.01016.63
7.2.200.0080.00916.40
7.2.190.0100.01016.41
7.2.180.0070.01516.55
7.2.170.0030.01416.58
7.2.160.0130.01016.68
7.2.150.0150.00517.45
7.2.140.0110.01017.35
7.2.130.0110.00917.28
7.2.120.0100.01117.41
7.2.110.0080.01017.37
7.2.100.0070.01217.24
7.2.90.0090.01017.52
7.2.80.0090.01117.42
7.2.70.0120.00817.31
7.2.60.0060.01217.46
7.2.50.0270.01917.36
7.2.40.0060.01217.30
7.2.30.0130.01117.47
7.2.20.0110.01217.55
7.2.10.0100.01017.40
7.2.00.0110.00718.34
7.1.330.0230.01216.35
7.1.320.0180.01016.15
7.1.310.0140.01016.34
7.1.300.0130.01316.52
7.1.290.0150.00616.29
7.1.280.0140.01116.12
7.1.270.0190.00616.31
7.1.260.0240.00416.15
7.1.250.0100.00816.29
7.1.240.0320.00816.36
7.1.230.0110.01216.14
7.1.220.0200.00516.35
7.1.210.0120.01116.30
7.1.200.0130.00716.38
7.1.190.0130.01116.34
7.1.180.0180.00516.42
7.1.170.0130.01016.27
7.1.160.0120.01116.38
7.1.150.0200.01116.42
7.1.140.0190.00516.29
7.1.130.0170.00716.27
7.1.120.0150.00716.17
7.1.110.0170.00816.37
7.1.100.0120.00917.14
7.1.90.0170.00916.39
7.1.80.0090.01516.22
7.1.70.0120.00716.79
7.1.60.0090.01517.32
7.1.50.0150.01016.63
7.1.40.0150.01116.37
7.1.30.0200.00816.43
7.1.20.0130.01216.20
7.1.10.0160.00616.26
7.1.00.0120.03218.56
7.0.330.0050.01015.90
7.0.320.0180.00715.93
7.0.310.0100.01215.89
7.0.300.0140.00715.79
7.0.290.0160.00916.04
7.0.280.0150.01316.13
7.0.270.0170.00615.95
7.0.260.0150.01116.05
7.0.250.0720.01016.03
7.0.240.0140.01115.99
7.0.230.0530.01216.14
7.0.220.0140.01016.13
7.0.210.0110.01615.92
7.0.200.0070.01316.45
7.0.190.0090.01716.23
7.0.180.0180.00816.05
7.0.170.0110.01116.01
7.0.160.0190.00515.79
7.0.150.0130.01316.10
7.0.140.0150.00816.07
7.0.130.0150.00715.90
7.0.120.0120.01116.04
7.0.110.0120.01215.92
7.0.100.0260.00915.88
7.0.90.0090.01615.93
7.0.80.0140.01016.00
7.0.70.0110.01716.06
7.0.60.0480.02917.45
7.0.50.0140.03616.81
7.0.40.0110.02316.94
7.0.30.0240.02316.87
7.0.20.0340.02916.94
7.0.10.0130.02016.84
7.0.00.0130.01716.87
5.6.400.0100.00715.83
5.6.390.0130.00615.73
5.6.380.0110.01115.53
5.6.370.0140.00715.55
5.6.360.0130.01015.62
5.6.350.0140.01315.62
5.6.340.0140.01015.70
5.6.330.0110.01215.64
5.6.320.0130.00915.74
5.6.310.0120.01215.80
5.6.300.0120.01215.62
5.6.290.0110.01215.66
5.6.280.0100.03217.58
5.6.270.0160.01115.72
5.6.260.0200.00715.63
5.6.250.0150.00915.64
5.6.240.0160.00815.70
5.6.230.0170.01015.58
5.6.220.0140.01115.65
5.6.210.0140.03217.33
5.6.200.0110.02716.60
5.6.190.0090.03617.47
5.6.180.0150.03917.38
5.6.170.0190.02217.39
5.6.160.0120.02217.40
5.6.150.0140.02316.75
5.6.140.0130.02216.67
5.6.130.0130.02716.59
5.6.120.0180.03317.59
5.6.110.0130.03417.47
5.6.100.0090.02617.68
5.6.90.0140.02117.65
5.6.80.0140.03417.27
5.6.70.0140.00815.58
5.6.60.0190.00915.71
5.6.50.0070.01415.64
5.6.40.0130.01115.59
5.6.30.0140.01315.61
5.6.20.0120.01315.47
5.6.10.0170.01215.61
5.6.00.0150.01015.62
5.5.380.0130.01415.33
5.5.370.0140.01015.48
5.5.360.0190.00715.44
5.5.350.0140.03817.22
5.5.340.0030.02916.47
5.5.330.0150.02617.39
5.5.320.0350.02517.20
5.5.310.0180.03017.38
5.5.300.0150.03416.49
5.5.290.0150.03616.58
5.5.280.0120.03217.69
5.5.270.0100.03617.28
5.5.260.0130.02917.41
5.5.250.0080.02317.25
5.5.240.0140.03617.35
5.5.230.0140.00715.52
5.5.220.0190.00815.44
5.5.210.0120.01615.37
5.5.200.0170.00915.64
5.5.190.0110.01415.32
5.5.180.0150.01215.40
5.5.170.0080.01315.51
5.5.160.0160.00715.57
5.5.150.0130.01615.63
5.5.140.0150.01015.49
5.5.130.0120.01315.51
5.5.120.0140.01115.60
5.5.110.0150.01215.59
5.5.100.0090.01415.50
5.5.90.0140.01015.29
5.5.80.0120.01315.50
5.5.70.0140.01115.44
5.5.60.0140.00715.54
5.5.50.0180.00415.62
5.5.40.0100.01615.64
5.5.30.0110.01415.74
5.5.20.0120.01015.29
5.5.10.0120.01415.53
5.5.00.0100.01415.36

preferences:
52.17 ms | 401 KiB | 5 Q