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) { $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.60.0130.00717.00
8.3.50.0110.00718.05
8.3.40.0120.00318.93
8.3.30.0140.00018.93
8.3.20.0080.00018.76
8.3.10.0080.00020.10
8.3.00.0060.00317.93
8.2.180.0120.01218.18
8.2.170.0040.01222.96
8.2.160.0080.00619.34
8.2.150.0040.00424.18
8.2.140.0040.01124.66
8.2.130.0040.00419.19
8.2.120.0000.00726.35
8.2.110.0110.00022.25
8.2.100.0060.00617.94
8.2.90.0030.00618.15
8.2.80.0000.00818.34
8.2.70.0060.00317.75
8.2.60.0080.00018.05
8.2.50.0040.00418.10
8.2.40.0000.00822.23
8.2.30.0040.00420.57
8.2.20.0040.00417.95
8.2.10.0000.00818.20
8.2.00.0050.00318.23
8.1.280.0090.00625.92
8.1.270.0080.00023.99
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.67
8.1.230.0110.00021.02
8.1.220.0030.00517.79
8.1.210.0000.00918.79
8.1.200.0070.00317.50
8.1.190.0090.00017.35
8.1.180.0080.00018.10
8.1.170.0040.00418.93
8.1.160.0000.00818.96
8.1.150.0050.00219.00
8.1.140.0000.00719.60
8.1.130.0030.00317.60
8.1.120.0040.00417.45
8.1.110.0050.00317.48
8.1.100.0040.00417.53
8.1.90.0000.00917.48
8.1.80.0050.00317.50
8.1.70.0040.00417.37
8.1.60.0080.00017.57
8.1.50.0080.00317.63
8.1.40.0030.00517.54
8.1.30.0000.00917.73
8.1.20.0040.00417.65
8.1.10.0000.00817.54
8.1.00.0120.00017.58
8.0.300.0050.00319.89
8.0.290.0000.00816.88
8.0.280.0070.00018.46
8.0.270.0070.00017.33
8.0.260.0030.00317.38
8.0.250.0030.00317.00
8.0.240.0000.00717.00
8.0.230.0080.00017.02
8.0.220.0000.00717.04
8.0.210.0070.00016.93
8.0.200.0070.00017.04
8.0.190.0070.00017.10
8.0.180.0080.00017.00
8.0.170.0000.00816.95
8.0.160.0070.00016.96
8.0.150.0070.00016.98
8.0.140.0000.00716.89
8.0.130.0030.00313.45
8.0.120.0040.00416.89
8.0.110.0040.00416.85
8.0.100.0040.00416.82
8.0.90.0080.00016.81
8.0.80.0100.00616.91
8.0.70.0040.00417.10
8.0.60.0050.00316.87
8.0.50.0030.00516.91
8.0.30.0110.00917.14
8.0.20.0110.00917.41
8.0.10.0050.00217.04
8.0.00.0080.01416.69
7.4.330.0030.00315.15
7.4.320.0030.00316.54
7.4.300.0030.00316.60
7.4.290.0030.00316.52
7.4.280.0070.00016.42
7.4.270.0000.00616.52
7.4.260.0000.00716.47
7.4.250.0070.00016.56
7.4.240.0070.00016.62
7.4.230.0040.00416.38
7.4.220.0070.02216.42
7.4.210.0090.00616.58
7.4.200.0040.00416.60
7.4.160.0060.00916.49
7.4.150.0110.00617.40
7.4.140.0090.00917.86
7.4.130.0050.01316.58
7.4.120.0100.00716.53
7.4.110.0100.00616.61
7.4.100.0100.00616.61
7.4.90.0060.01116.61
7.4.80.0120.00419.39
7.4.70.0140.00416.43
7.4.60.0060.01016.78
7.4.50.0040.01016.41
7.4.40.0100.00716.57
7.4.30.0060.01016.84
7.4.00.0110.00415.00
7.3.330.0000.00513.28
7.3.320.0030.00313.46
7.3.310.0040.00416.30
7.3.300.0000.00716.46
7.3.290.0000.00716.33
7.3.280.0080.01116.32
7.3.270.0080.01117.40
7.3.260.0150.00316.48
7.3.250.0100.00916.42
7.3.240.0070.01116.49
7.3.230.0040.01416.41
7.3.210.0100.01016.52
7.3.200.0100.00719.39
7.3.190.0130.00316.43
7.3.180.0060.01416.31
7.3.170.0070.01016.43
7.3.160.0070.01016.63
7.3.120.0130.00514.77
7.3.110.0070.01214.78
7.3.100.0120.00614.91
7.3.90.0080.00714.97
7.3.80.0020.01414.69
7.3.70.0070.00514.84
7.3.60.0070.00414.68
7.3.50.0090.00614.76
7.3.40.0020.01014.67
7.3.30.0050.00714.71
7.3.20.0080.00416.49
7.3.10.0020.01116.52
7.3.00.0040.00716.48
7.2.330.0110.00616.64
7.2.320.0080.01116.51
7.2.310.0150.00916.79
7.2.300.0100.00716.92
7.2.290.0060.01016.55
7.2.250.0070.01015.32
7.2.240.0080.01014.91
7.2.230.0120.00515.09
7.2.220.0110.00615.05
7.2.210.0020.01415.25
7.2.200.0050.01214.97
7.2.190.0020.01214.79
7.2.180.0080.00614.94
7.2.170.0050.00714.99
7.2.160.0030.01015.04
7.2.150.0070.00716.79
7.2.140.0020.01116.91
7.2.130.0070.00616.76
7.2.120.0030.01116.87
7.2.110.0060.00816.92
7.2.100.0060.00516.69
7.2.90.0090.00316.83
7.2.80.0090.00516.95
7.2.70.0090.00716.84
7.2.60.0050.00916.83
7.2.50.0040.00616.84
7.2.40.0050.01216.89
7.2.30.0060.00616.65
7.2.20.0070.00416.79
7.2.10.0120.00216.79
7.2.00.0040.00917.77
7.1.330.0040.01115.92
7.1.320.0070.00715.78
7.1.310.0050.01015.77
7.1.300.0040.00715.63
7.1.290.0080.00515.72
7.1.280.0040.00615.60
7.1.270.0050.00715.81
7.1.260.0070.00415.53
7.1.250.0070.00715.68
7.1.240.0060.00715.81
7.1.230.0080.00615.77
7.1.220.0030.00615.68
7.1.210.0020.01115.61
7.1.200.0040.00715.72
7.1.190.0070.00615.82
7.1.180.0060.00615.68
7.1.170.0090.00315.71
7.1.160.0050.00915.80
7.1.150.0030.00815.63
7.1.140.0050.00815.80
7.1.130.0070.00715.67
7.1.120.0030.00915.82
7.1.110.0050.00515.89
7.1.100.0100.00616.38
7.1.90.0040.01015.73
7.1.80.0060.00515.88
7.1.70.0050.00616.12
7.1.60.0070.01016.83
7.1.50.0060.00716.15
7.1.40.0060.00415.73
7.1.30.0070.00915.85
7.1.20.0070.00515.68
7.1.10.0080.00615.60
7.1.00.0040.03318.02
7.0.330.0030.00915.40
7.0.320.0050.00615.33
7.0.310.0050.00715.47
7.0.300.0030.01115.14
7.0.290.0030.00715.30
7.0.280.0050.00715.31
7.0.270.0050.00815.06
7.0.260.0040.01115.38
7.0.250.0000.01215.51
7.0.240.0020.00615.28
7.0.230.0000.01315.30
7.0.220.0020.01115.35
7.0.210.0030.00515.35
7.0.200.0020.01115.80
7.0.190.0090.00615.38
7.0.180.0030.00815.20
7.0.170.0050.01015.20
7.0.160.0030.01015.34
7.0.150.0090.00315.38
7.0.140.0090.00715.44
7.0.130.0040.00615.32
7.0.120.0050.00715.37
7.0.110.0060.00515.50
7.0.100.0070.00715.33
7.0.90.0040.01916.91
7.0.80.0040.01716.92
7.0.70.0030.01916.91
7.0.60.0040.01916.87
7.0.50.0050.01717.12
7.0.40.0060.02315.61
7.0.30.0080.02615.59
7.0.20.0090.02415.53
7.0.10.0090.03015.56
7.0.00.0060.03115.66
5.6.400.0070.00514.49
5.6.390.0030.01114.22
5.6.380.0020.00914.25
5.6.370.0110.00514.40
5.6.360.0080.00714.36
5.6.350.0060.00614.39
5.6.340.0050.00714.69
5.6.330.0080.00514.44
5.6.320.0030.01114.52
5.6.310.0080.00714.31
5.6.300.0050.00814.54
5.6.290.0060.01014.43
5.6.280.0080.02716.74
5.6.270.0050.00814.12
5.6.260.0100.00614.39
5.6.250.0060.00914.26
5.6.240.0090.01616.47
5.6.230.0070.02316.42
5.6.220.0050.01916.61
5.6.210.0070.02216.52
5.6.200.0040.02616.62
5.6.190.0060.01816.73
5.6.180.0080.02616.60
5.6.170.0070.03016.59
5.6.160.0080.03116.56
5.6.150.0060.02816.72
5.6.140.0090.03116.67
5.6.130.0060.02416.51
5.6.120.0070.02816.56
5.6.110.0050.03316.76
5.6.100.0070.01816.74
5.6.90.0040.03316.60
5.6.80.0150.02016.44
5.6.70.0060.02016.30
5.6.60.0070.03216.39
5.6.50.0030.03216.37
5.6.40.0030.02516.34
5.6.30.0060.02316.32
5.6.20.0050.02216.27
5.6.10.0040.03316.28
5.6.00.0050.03016.36
5.5.380.0040.01916.43
5.5.370.0050.01816.29
5.5.360.0060.02116.37
5.5.350.0040.01816.45
5.5.340.0100.01816.66
5.5.330.0060.02016.50
5.5.320.0040.02316.43
5.5.310.0080.01916.38
5.5.300.0070.02616.40
5.5.290.0040.02216.45
5.5.280.0050.03116.42
5.5.270.0070.03316.49
5.5.260.0110.02916.63
5.5.250.0070.02116.50
5.5.240.0070.02816.21
5.5.230.0050.02916.23
5.5.220.0080.03016.29
5.5.210.0060.03216.38
5.5.200.0030.03216.29
5.5.190.0090.03016.07
5.5.180.0070.02716.13
5.5.170.0000.01214.35
5.5.160.0020.02516.28
5.5.150.0050.02016.17
5.5.140.0060.03116.28
5.5.130.0090.02716.44
5.5.120.0060.01716.29
5.5.110.0060.02016.39
5.5.100.0080.02716.10
5.5.90.0030.03116.22
5.5.80.0060.02416.26
5.5.70.0060.02716.21
5.5.60.0110.02315.95
5.5.50.0070.01616.34
5.5.40.0080.03016.27
5.5.30.0090.02616.17
5.5.20.0080.01716.19
5.5.10.0070.03015.94
5.5.00.0090.02716.16
5.4.450.0030.08319.46
5.4.440.0000.05319.46
5.4.430.0030.04719.36
5.4.420.0130.03719.41
5.4.410.0130.07019.09
5.4.400.0030.05019.13
5.4.390.0070.03719.21
5.4.380.0070.04319.05
5.4.370.0030.06018.85
5.4.360.0070.05719.16
5.4.350.0100.07319.22
5.4.340.0070.05019.08
5.4.320.0070.06318.88
5.4.310.0230.06319.16
5.4.300.0100.04019.21
5.4.290.0130.07319.16
5.4.280.0070.05019.03
5.4.270.0070.07018.95
5.4.260.0170.06019.03
5.4.250.0030.06719.13
5.4.240.0200.06718.89
5.4.230.0070.07019.02
5.4.220.0070.07319.08
5.4.210.0000.05019.23
5.4.200.0030.08019.22
5.4.190.0130.07319.04
5.4.180.0000.04719.17
5.4.170.0200.06019.22
5.4.160.0030.05718.88
5.4.150.0070.08719.19
5.4.140.0030.06716.19
5.4.130.0070.07316.36
5.4.120.0070.04316.20
5.4.110.0100.07316.48
5.4.100.0070.07316.55
5.4.90.0070.07016.50
5.4.80.0100.05716.43
5.4.70.0030.07016.41
5.4.60.0030.07316.26
5.4.50.0000.07016.31
5.4.40.0030.07716.54
5.4.30.0070.06716.36
5.4.20.0070.04016.44
5.4.10.0030.05316.44
5.4.00.0100.06715.64
5.3.290.0030.07014.75
5.3.280.0030.07014.63
5.3.270.0070.07714.68
5.3.260.0030.08014.61
5.3.250.0100.07314.70
5.3.240.0070.06014.61
5.3.230.0100.04714.59
5.3.220.0130.06714.72
5.3.210.0070.07714.64
5.3.200.0070.07314.57
5.3.190.0070.05314.56
5.3.180.0070.07714.56
5.3.170.0030.04314.67
5.3.160.0070.07014.50
5.3.150.0070.04714.55
5.3.140.0000.05014.67
5.3.130.0030.05314.69
5.3.120.0070.07714.66
5.3.110.0070.07314.70
5.3.100.0030.05014.11
5.3.90.0070.07313.96
5.3.80.0030.06714.16
5.3.70.0000.04714.18
5.3.60.0030.04014.13
5.3.50.0130.07013.98
5.3.40.0070.07714.00
5.3.30.0070.07313.94
5.3.20.0130.04013.77
5.3.10.0030.06313.81
5.3.00.0070.05013.66
5.2.170.0070.06011.11
5.2.160.0070.04311.15
5.2.150.0030.06711.17
5.2.140.0100.04711.19
5.2.130.0030.06711.21
5.2.120.0070.05311.24
5.2.110.0000.04711.25
5.2.100.0000.03711.02
5.2.90.0030.03311.19
5.2.80.0070.05711.03
5.2.70.0030.06711.17
5.2.60.0030.04711.06
5.2.50.0100.05711.14
5.2.40.0070.05011.00
5.2.30.0030.06311.04
5.2.20.0000.04311.08
5.2.10.0070.05710.92
5.2.00.0070.03010.79
5.1.60.0130.03010.13
5.1.50.0070.04010.13
5.1.40.0070.04010.13
5.1.30.0000.06310.21
5.1.20.0070.04310.38
5.1.10.0030.04010.13
5.1.00.0030.05710.23
5.0.50.0070.02310.13
5.0.40.0000.04310.13
5.0.30.0030.06310.13
5.0.20.0100.04010.13
5.0.10.0100.04010.13
5.0.00.0000.06710.13
4.4.90.0030.02310.13
4.4.80.0000.03710.13
4.4.70.0000.03310.13
4.4.60.0030.02310.13
4.4.50.0030.03310.13
4.4.40.0000.05310.13
4.4.30.0070.03010.13
4.4.20.0030.01710.13
4.4.10.0030.02310.13
4.4.00.0030.04010.13
4.3.110.0100.01710.13
4.3.100.0000.03710.13
4.3.90.0100.03010.13
4.3.80.0000.05710.13
4.3.70.0030.03310.13
4.3.60.0030.02710.13
4.3.50.0030.03310.13
4.3.40.0030.02710.13
4.3.30.0000.01710.13
4.3.20.0000.02310.13
4.3.10.0000.02310.13
4.3.00.0030.02010.13

preferences:
72.86 ms | 401 KiB | 5 Q