3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); header('allow-origin: *'); header("Access-Control-Allow-Headers: ACCEPT, CONTENT-TYPE, X-CSRF-TOKEN"); header("Access-Control-Allow-Methods: GET, POST, OPTIONS, DELETE"); //header('Access-Control-Allow-Origin: http://www.foo.com', false); $url = $_GET["https://pastebin.com/raw/t1mBJ2Yi"]; if(isset($url)) { $m3ufile = file_get_contents($url); } else { $url = "https://pastebin.com/raw/t1mBJ2Yi"; $m3ufile = file_get_contents($url); } //$re = '/#(EXTINF|EXTM3U):(.+?)[,]\s?(.+?)[\r\n]+?((?:https?|rtmp):\/\/(?:\S*?\.\S*?)(?:[\s)\[\]{};"\'<]|\.\s|$))/'; $re = '/#EXTINF:(.+?)[,]\s?(.+?)[\r\n]+?((?:https?|rtmp):\/\/(?:\S*?\.\S*?)(?:[\s)\[\]{};"\'<]|\.\s|$))/'; //$attributes = '/([a-zA-Z0-9\-]+?)="([^"]*)"/'; $attributes = '/([a-zA-Z0-9\-\_]+?)="([^"]*)"/'; $m3ufile = str_replace('tvg-logo', 'thumb_square', $m3ufile); $m3ufile = str_replace('tvg-id', 'id', $m3ufile); //$m3ufile = str_replace('tvg-name', 'group', $m3ufile); //$m3ufile = str_replace('tvg-name', 'name', $m3ufile); $m3ufile = str_replace('tvg-name', 'author', $m3ufile); $m3ufile = str_replace('group-title', 'group', $m3ufile); $m3ufile = str_replace('tvg-country', 'country', $m3ufile); $m3ufile = str_replace('tvg-language', 'language', $m3ufile); //print_r($m3ufile); //$m3ufile = str_replace(' ', '_', $m3ufile); // FOR GROUP preg_match_all($re, $m3ufile, $matches); // Print the entire match result //print_r($matches); $items = array(); foreach($matches[0] as $list) { //echo "$list <br>"; preg_match($re, $list, $matchList); //$mediaURL = str_replace("\r\n","",$matchList[4]); //$mediaURL = str_replace("\n","",$matchList[4]); //$mediaURL = str_replace("\n","",$mediaURL); $mediaURL = preg_replace("/[\n\r]/","",$matchList[3]); $mediaURL = preg_replace('/\s+/', '', $mediaURL); //$mediaURL = preg_replace( "/\r|\n/", "", $matches[4] ); $newdata = array ( //'ATTRIBUTE' => $matchList[2], 'service' => "iptv", 'title' => $matchList[2], //'playlistURL' => (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", //'playlistURL' => str_replace("url=","",$_SERVER['QUERY_STRING']), 'playlistURL' => $url, 'media_url' => $mediaURL, 'url' => $mediaURL ); preg_match_all($attributes, $list, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $newdata[$match[1]] = $match[2]; } //array_push($newdata,$attribute); //$newdata[] = $attribute; $items[] = $newdata; //$items[] = $matchList[2]; } // $globalitem = array ( // //'ATTRIBUTE' => $matchList[2], // 'item' => $items // ); //$globalitem[$items] ; //$globalitems['item'] = $items; //$globalist['list'] = $globalitems; $globalitems = array ( //'ATTRIBUTE' => $matchList[2], 'service' => "iptv", 'title' => "iptv", 'item' => $items, ); $globalist['list'] = $globalitems; //print_r($items); $callback= $_GET['callback']; if($callback) echo $callback. '(' . json_encode($globalist) . ')'; // jsonP callback else echo json_encode($globalist); ?>

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.5.10.0100.00816.90
8.5.00.0160.01820.26
8.4.150.0030.00014.05
8.4.140.0110.01017.80
8.4.130.0150.00617.92
8.4.120.0110.00724.02
8.4.110.0120.00919.92
8.4.100.0120.01019.01
8.4.90.0120.00820.81
8.4.80.0130.00518.73
8.4.70.0130.00618.30
8.4.60.0030.00618.90
8.4.50.0120.01018.71
8.4.40.0030.01719.95
8.4.30.0160.00319.63
8.4.20.0140.00719.88
8.4.10.0180.00319.93
8.3.280.0110.01118.91
8.3.270.0100.01417.18
8.3.260.0140.00517.27
8.3.250.0100.00919.22
8.3.240.0130.00717.30
8.3.230.0110.00816.95
8.3.220.0100.01119.02
8.3.210.0100.00817.32
8.3.200.0040.00516.79
8.3.190.0090.01017.06
8.3.180.0120.00817.41
8.3.170.0070.01120.87
8.3.160.0160.00317.34
8.3.150.0130.00617.32
8.3.140.0040.00417.35
8.3.130.0060.00318.64
8.3.120.0130.00620.77
8.3.110.0060.01020.94
8.3.100.0060.00317.00
8.3.90.0040.00426.77
8.3.80.0100.00017.97
8.3.70.0150.00718.68
8.3.60.0030.01316.88
8.3.50.0090.00717.71
8.3.40.0160.00019.21
8.3.30.0040.01119.22
8.3.20.0040.00421.82
8.3.10.0030.00523.64
8.3.00.0040.00422.10
8.2.290.0090.00820.68
8.2.280.0130.00618.41
8.2.270.0060.01217.44
8.2.260.0050.00316.86
8.2.250.0080.00016.98
8.2.240.0030.00517.08
8.2.230.0090.00622.58
8.2.220.0030.00516.85
8.2.210.0000.00926.77
8.2.200.0030.00617.13
8.2.190.0090.00917.00
8.2.180.0090.00616.88
8.2.170.0110.00722.96
8.2.160.0110.00420.22
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00019.54
8.2.110.0060.00321.25
8.2.100.0070.00418.28
8.2.90.0030.00518.22
8.2.80.0000.00818.05
8.2.70.0000.00818.16
8.2.60.0030.00517.75
8.2.50.0050.00318.10
8.2.40.0030.00522.06
8.2.30.0040.00421.19
8.2.20.0040.00418.37
8.2.10.0030.00518.32
8.2.00.0000.00718.21
8.1.330.0110.00922.25
8.1.320.0150.00516.58
8.1.310.0030.01118.64
8.1.300.0130.00316.74
8.1.290.0000.01030.84
8.1.280.0120.00325.92
8.1.270.0040.00422.20
8.1.260.0030.00726.35
8.1.250.0040.00428.09
8.1.240.0000.00823.91
8.1.230.0120.00021.09
8.1.220.0030.00617.90
8.1.210.0090.00018.97
8.1.200.0090.00017.60
8.1.190.0060.00617.38
8.1.180.0030.00618.10
8.1.170.0050.00318.88
8.1.160.0080.00018.89
8.1.150.0040.00422.00
8.1.140.0050.00317.86
8.1.130.0000.00819.15
8.1.120.0000.00717.63
8.1.110.0040.00717.72
8.1.100.0030.00517.54
8.1.90.0050.00217.62
8.1.80.0040.00417.55
8.1.70.0000.00817.63
8.1.60.0040.00417.74
8.1.50.0040.00417.63
8.1.40.0040.00417.74
8.1.30.0000.00817.76
8.1.20.0040.00417.90
8.1.10.0080.00017.63
8.1.00.0080.00017.71
8.0.300.0050.00320.02
8.0.290.0060.00317.00
8.0.280.0030.00318.63
8.0.270.0030.00717.29
8.0.260.0080.00018.48
8.0.250.0030.00317.26
8.0.240.0060.00617.27
8.0.230.0060.00317.25
8.0.220.0030.00617.24
8.0.210.0000.00817.10
8.0.200.0000.00717.23
8.0.190.0110.00017.24
8.0.180.0070.00017.11
8.0.170.0090.00017.23
8.0.160.0040.00417.18
8.0.150.0000.00717.16
8.0.140.0040.00417.16
8.0.130.0000.00713.68
8.0.120.0000.00817.20
8.0.110.0000.00817.20
8.0.100.0000.00817.15
8.0.90.0040.00417.19
8.0.80.0000.01617.25
8.0.70.0080.00017.07
8.0.60.0020.00517.21
8.0.50.0000.00817.14
8.0.30.0090.00917.54
8.0.20.0170.00317.40
8.0.10.0000.00817.23
8.0.00.0100.01017.05
7.4.330.0050.00015.55
7.4.320.0060.00016.89
7.4.300.0050.00216.80
7.4.290.0030.00316.92
7.4.280.0030.00616.80
7.4.270.0000.00716.90
7.4.260.0000.00716.83
7.4.250.0030.00616.89
7.4.240.0030.00316.77
7.4.230.0040.00416.83
7.4.220.0030.00516.94
7.4.210.0070.00716.86
7.4.200.0040.00416.84
7.4.160.0130.00616.78
7.4.140.0090.00917.86
7.4.130.0120.00616.84
7.4.120.0100.01016.91
7.4.110.0100.00716.75
7.4.100.0060.01616.74
7.4.90.0110.00716.84
7.4.80.0120.00919.39
7.4.70.0070.01516.93
7.4.60.0110.00616.80
7.4.50.0050.01416.56
7.4.40.0100.01316.80
7.4.10.0020.01715.09
7.4.00.0090.00915.22
7.3.330.0050.00013.32
7.3.320.0030.00313.49
7.3.310.0030.00516.70
7.3.300.0000.00716.57
7.3.290.0050.00216.61
7.3.280.0070.01216.63
7.3.260.0120.00916.84
7.3.240.0070.01216.55
7.3.230.0060.01016.62
7.3.210.0110.00716.70
7.3.200.0090.00916.75
7.3.190.0190.00416.64
7.3.180.0110.00516.67
7.3.170.0160.00316.91
7.3.160.0110.00616.48
7.3.130.0050.01315.05
7.3.120.0090.00915.13
7.3.110.0100.00915.10
7.3.100.0050.00915.09
7.3.90.0100.00614.90
7.3.80.0050.01014.96
7.3.70.0080.00514.99
7.3.60.0080.00515.12
7.3.50.0080.00615.14
7.3.40.0060.00815.06
7.3.30.0070.00714.90
7.3.20.0060.01016.44
7.3.10.0060.00816.34
7.3.00.0080.00616.40
7.2.330.0090.00916.86
7.2.320.0060.01416.82
7.2.310.0090.00916.91
7.2.300.0120.00616.81
7.2.290.0110.00716.88
7.2.260.0050.01415.34
7.2.250.0050.01315.33
7.2.240.0080.00815.32
7.2.230.0090.00615.15
7.2.220.0080.00715.21
7.2.210.0040.01215.32
7.2.200.0050.00815.24
7.2.190.0060.01015.26
7.2.180.0030.01215.30
7.2.170.0080.00615.32
7.2.160.0070.01115.27
7.2.150.0050.01016.53
7.2.140.0090.00816.57
7.2.130.0060.01016.52
7.2.120.0070.00916.54
7.2.110.0080.00916.50
7.2.100.0080.00916.59
7.2.90.0090.00616.47
7.2.80.0060.00816.42
7.2.70.0070.00916.49
7.2.60.0070.00916.67
7.2.50.0100.00416.64
7.2.40.0090.00616.52
7.2.30.0090.01517.32
7.2.20.0060.01217.00
7.2.10.0090.00817.12
7.2.00.0080.00816.99
7.1.330.0090.00615.97
7.1.320.0060.01015.58
7.1.310.0090.00415.47
7.1.300.0090.00715.53
7.1.290.0040.00915.57
7.1.280.0100.00315.44
7.1.270.0060.01215.45
7.1.260.0100.00415.67
7.1.250.0080.00815.56
7.1.240.0050.01015.30
7.1.230.0070.00915.33
7.1.220.0080.00715.46
7.1.210.0080.00715.36
7.1.200.0060.00715.54
7.1.190.0070.01015.41
7.1.180.0050.00915.46
7.1.170.0060.00715.37
7.1.160.0050.01115.29
7.1.150.0090.00815.97
7.1.140.0090.00815.84
7.1.130.0110.01015.89
7.1.120.0080.00915.90
7.1.110.0090.00615.83
7.1.100.0090.00815.86
7.1.90.0070.00715.72
7.1.80.0090.00815.73
7.1.70.0090.01115.63
7.1.60.0120.01119.95
7.1.50.0120.01220.01
7.1.40.0130.01219.68
7.1.30.0060.01119.89
7.1.20.0140.00819.94
7.1.10.0070.00815.11
7.1.00.0100.00715.42
7.0.330.0070.00713.85
5.6.400.0090.00614.23
5.6.390.0110.00714.42
5.6.380.0060.01114.56

preferences:
42.35 ms | 403 KiB | 5 Q