3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['url']='https://www.lostfilm.tv/serials.php'; if(!$_GET['url']) exit; function gethtml($html) { echo 123; $ch = curl_init(); //open curl handle curl_setopt($ch, CURLOPT_URL, $html); //set an url curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //do not output directly, use variable curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); //do a binary transfer curl_setopt($ch, CURLOPT_FAILONERROR, 1); //stop if an error occurred $file=curl_exec($ch); //store the content in variable if(!curl_errno($ch)) { //header ("Content-type: ".curl_getinfo($ch, CURLINFO_CONTENT_TYPE).""); //header ("Content-Length: ".curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD).""); // echo $file; return $file; } else echo 'Curl error: ' . curl_error($ch); curl_close($ch); } $url = $_GET['url']; if(!is_null($_GET['url'])) { $dom = new DOMDocument; @$dom->loadHTML(gethtml($url)); echo json_encode(123); $xpath = new DOMXpath($dom); $links = iterator_to_array($xpath->query('//*[@class="a_discuss"]')); $names = iterator_to_array($xpath->query('//*[@id="new_sd_list"]/span[*]/a/text()')); $array = array(); echo json_encode(123); for($i = 0; $i < count($links) && $i < count($names); ++$i) { $array[0][$i] = mb_convert_encoding($names[$i]->nodue, 'Windows-1251', 'UTF-8'); $array[1][$i] = $links[$i] = str_replace("/discuss.php?cat", "https://www.lostfilm.tv/nrdr2.php?c", $links[$i]->attributes->getNamedItem("href")->nodue); // echo json_encode($array); // echo "<br/>name". $i ."|". mb_convert_encoding($names[$i]->nodue, 'Windows-1251', 'UTF-8'); // echo "<br/>link". $i ."|". $links[$i] = str_replace("/discuss.php?cat", "https://www.lostfilm.tv/nrdr2.php?c", $links[$i]->attributes->getNamedItem("href")->nodue); } echo "var_dump<br />"; echo var_dump($array)."<br /><br />"; echo "print_r<br />"; print_r($array); echo "<br /><br />json_encode<br />"; }

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.70.0110.00416.88
8.3.60.0090.00916.59
8.3.50.0120.01221.14
8.3.40.0120.00618.92
8.3.30.0110.00318.60
8.3.20.0050.00318.86
8.3.10.0080.00019.98
8.3.00.0130.00617.93
8.2.180.0110.00718.66
8.2.170.0040.01122.96
8.2.160.0090.00519.18
8.2.150.0000.00824.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00421.19
8.2.110.0070.00321.16
8.2.100.0090.00318.05
8.2.90.0040.00419.11
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0030.00617.93
8.2.50.0040.00418.10
8.2.40.0000.00822.36
8.2.30.0000.00720.54
8.2.20.0000.00817.92
8.2.10.0070.00018.26
8.2.00.0000.00718.01
8.1.280.0070.01125.92
8.1.270.0040.00423.79
8.1.260.0030.00626.35
8.1.250.0070.00028.09
8.1.240.0070.00322.55
8.1.230.0090.00318.96
8.1.220.0040.00417.77
8.1.210.0030.00618.77
8.1.200.0030.00617.47
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0040.00418.39
8.1.160.0000.00719.10
8.1.150.0000.00818.82
8.1.140.0070.00019.51
8.1.130.0030.00317.72
8.1.120.0040.00417.52
8.1.110.0030.00517.55
8.1.100.0040.00417.45
8.1.90.0040.00417.52
8.1.80.0040.00417.48
8.1.70.0000.00717.43
8.1.60.0030.00517.55
8.1.50.0000.01117.54
8.1.40.0040.00417.50
8.1.30.0000.00817.67
8.1.20.0000.00817.59
8.1.10.0030.00517.55
8.1.00.0000.01217.52
8.0.300.0000.00718.77
8.0.290.0030.00716.75
8.0.280.0000.00718.45
8.0.270.0040.00417.34
8.0.260.0040.00417.27
8.0.250.0030.00317.02
8.0.240.0000.00717.06
8.0.230.0030.00316.96
8.0.220.0020.00516.93
8.0.210.0000.00716.99
8.0.200.0030.00317.10
8.0.190.0080.00017.01
8.0.180.0040.00417.05
8.0.170.0040.00416.97
8.0.160.0000.00716.96
8.0.150.0000.00716.91
8.0.140.0050.00216.98
8.0.130.0060.00013.43
8.0.120.0050.00316.93
8.0.110.0040.00417.04
8.0.100.0000.00716.79
8.0.90.0030.00517.05
8.0.80.0090.00617.07
8.0.70.0000.00716.99
8.0.60.0000.00816.76
8.0.50.0000.00717.03
8.0.30.0100.00817.19
8.0.20.0150.00817.40
8.0.10.0000.00817.22
8.0.00.0120.00916.98
7.4.330.0000.00715.08
7.4.320.0030.00316.64
7.4.300.0000.00616.52
7.4.290.0000.00716.52
7.4.280.0040.00416.66
7.4.270.0000.00716.46
7.4.260.0070.00016.47
7.4.250.0000.00716.68
7.4.240.0040.00316.62
7.4.230.0000.00716.36
7.4.220.0100.01016.77
7.4.210.0110.00816.58
7.4.200.0040.00416.62
7.4.160.0160.00016.51
7.4.150.0100.00717.40
7.4.140.0070.01217.86
7.4.130.0080.01016.65
7.4.120.0100.00716.64
7.4.110.0030.01616.58
7.4.100.0130.00416.63
7.4.90.0110.00616.36
7.4.80.0130.01019.39
7.4.70.0060.01216.45
7.4.60.0130.00316.64
7.4.50.0040.01116.71
7.4.40.0120.00416.47
7.4.30.0100.00716.43
7.4.00.0030.00915.14
7.3.330.0050.00013.35
7.3.320.0030.00313.29
7.3.310.0000.00716.30
7.3.300.0030.00316.25
7.3.290.0040.00416.30
7.3.280.0070.01216.40
7.3.270.0110.00717.40
7.3.260.0070.01116.39
7.3.250.0110.00516.42
7.3.240.0080.00916.44
7.3.230.0080.00816.39
7.3.210.0110.01116.47
7.3.200.0210.00019.39
7.3.190.0080.00816.67
7.3.180.0090.00616.54
7.3.170.0110.00616.38
7.3.160.0100.00616.57
7.3.00.0030.01616.48
7.2.330.0070.01116.86
7.2.320.0130.01016.83
7.2.310.0100.00716.62
7.2.300.0130.00316.60
7.2.290.0070.01016.87
7.2.130.0150.00416.75
7.2.120.0090.00316.76
7.2.110.0000.01416.95
7.2.100.0040.00816.95
7.2.90.0070.01017.07
7.2.80.0040.00417.04
7.2.70.0080.00816.79
7.2.60.0090.00217.08
7.2.50.0060.00617.04
7.2.40.0000.01116.88
7.2.30.0120.00316.71
7.2.20.0070.01017.00
7.2.10.0000.01416.86
7.2.00.0110.00918.27
7.1.250.0060.00315.81
7.1.240.0060.00615.45
7.1.230.0030.00615.77
7.1.220.0120.00315.85
7.1.210.0090.00315.72
7.1.200.0070.00515.76
7.1.190.0060.00315.58
7.1.180.0100.00015.71
7.1.170.0070.00715.59
7.1.160.0040.00715.72
7.1.150.0030.00915.82
7.1.140.0000.01015.89
7.1.130.0000.01415.89
7.1.120.0030.00715.58
7.1.110.0030.00915.71
7.1.100.0170.00516.76
7.1.90.0040.00715.78
7.1.80.0030.00715.96
7.1.70.0050.00616.58
7.1.60.0090.00917.56
7.1.50.0110.01016.49
7.1.40.0070.01015.79
7.1.30.0070.01015.91
7.1.20.0080.00415.72
7.1.10.0030.00715.95
7.1.00.0030.04419.15
7.0.330.0030.01315.57
7.0.320.0040.00415.49
7.0.310.0100.00315.23
7.0.300.0070.00315.21
7.0.290.0100.00315.43
7.0.280.0070.00415.41
7.0.270.0070.00315.37
7.0.260.0000.01215.24
7.0.250.0030.00815.29
7.0.240.0060.00315.59
7.0.230.0030.00715.59
7.0.220.0040.00715.39
7.0.210.0000.01015.51
7.0.200.0020.00716.02
7.0.190.0030.01015.59
7.0.180.0070.00715.50
7.0.170.0040.00815.54
7.0.160.0130.00015.63
7.0.150.0070.00715.57
7.0.140.0000.01015.53
7.0.130.0040.00715.57
7.0.120.0060.00615.43
7.0.110.0120.00315.42
7.0.100.0040.01115.28
7.0.90.0100.02717.61
7.0.80.0090.04517.60
7.0.70.0040.03417.74
7.0.60.0080.02517.74
7.0.50.0060.04317.80
7.0.40.0080.04116.80
7.0.30.0120.03816.74
7.0.20.0110.03516.70
7.0.10.0100.03716.76
7.0.00.0090.04316.77
5.6.380.0110.00314.70
5.6.370.0030.00514.66
5.6.360.0000.01714.45
5.6.350.0080.00314.61
5.6.340.0070.01014.61
5.6.330.0060.00614.44
5.6.320.0000.01114.13
5.6.310.0000.01014.41
5.6.300.0030.01014.77
5.6.290.0070.00714.74
5.6.280.0050.04017.90
5.6.270.0030.01014.55
5.6.260.0030.00614.63
5.6.250.0070.00414.35
5.6.240.0090.02617.61
5.6.230.0120.03617.52
5.6.220.0050.03917.51
5.6.210.0090.04317.59
5.6.200.0100.04317.87
5.6.190.0050.03517.77
5.6.180.0080.02817.80
5.6.170.0100.04417.63
5.6.160.0080.03817.92
5.6.150.0040.02917.71
5.6.140.0100.03017.66
5.6.130.0090.04317.77
5.6.120.0100.04017.74
5.6.110.0090.04617.82
5.6.100.0100.02317.82
5.6.90.0050.04317.87
5.6.80.0030.04117.40
5.6.70.0130.03317.46
5.6.60.0030.04517.42
5.6.50.0030.02817.53
5.6.40.0130.03817.51
5.6.30.0120.03517.31
5.6.20.0020.03017.44
5.6.10.0050.04317.46
5.6.00.0030.03017.43
5.5.380.0050.04115.84
5.5.370.0080.04715.88
5.5.360.0030.04315.79
5.5.350.0080.02015.79
5.5.340.0080.02516.10
5.5.330.0060.04416.12
5.5.320.0050.04716.01
5.5.310.0080.02016.07
5.5.300.0010.04616.02
5.5.290.0030.04816.11
5.5.280.0030.04516.19
5.5.270.0030.04816.07
5.5.260.0090.04116.06
5.5.250.0070.04216.09
5.5.240.0120.04015.75
5.5.230.0020.04615.68
5.5.220.0030.03015.73
5.5.210.0030.03015.87
5.5.200.0080.03915.68
5.5.190.0110.03915.70
5.5.180.0030.04415.67
5.5.170.0030.00711.36
5.5.160.0050.03915.70
5.5.150.0100.03615.71
5.5.140.0100.03315.73
5.5.130.0060.03115.71
5.5.120.0090.03415.80
5.5.110.0100.03615.59
5.5.100.0000.02815.66
5.5.90.0050.02515.79
5.5.80.0040.02215.67
5.5.70.0100.03815.63
5.5.60.0070.03915.61
5.5.50.0050.04015.68
5.5.40.0050.04015.67
5.5.30.0080.03515.74
5.5.20.0030.03015.60
5.5.10.0060.02015.62
5.5.00.0080.03515.69

preferences:
70.18 ms | 401 KiB | 5 Q