3v4l.org

run code in 300+ PHP versions simultaneously
<?php function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); curl_close($ch); return $data; } $html = file_get_contents_curl("http://google.com/"); //parsing begins here: $doc = new DOMDocument(); @$doc->loadHTML($html); $nodes = $doc->getElementsByTagName('title'); //get and display what you need: $title = $nodes->item(0)->nodeValue; $metas = $doc->getElementsByTagName('meta'); for ($i = 0; $i < $metas->length; $i++) { $meta = $metas->item($i); if($meta->getAttribute('name') == 'description') $description = $meta->getAttribute('content'); if($meta->getAttribute('name') == 'keywords') $keywords = $meta->getAttribute('content'); } echo "Title: $title". '<br/><br/>'; echo "Description: $description". '<br/><br/>'; echo "Keywords: $keywords"; ?>

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.40.0140.00418.84
8.3.30.0070.00719.13
8.3.20.0060.00320.39
8.3.10.0050.00223.57
8.3.00.0000.00819.20
8.2.170.0150.00622.96
8.2.160.0070.00720.43
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0090.00020.91
8.2.110.0070.00322.01
8.2.100.0070.00417.91
8.2.90.0040.00419.27
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0030.00917.80
8.2.50.0050.00318.07
8.2.40.0000.00821.11
8.2.30.0040.00418.12
8.2.20.0080.00017.73
8.2.10.0000.00717.97
8.2.00.0000.00717.67
8.1.270.0090.00023.91
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00623.91
8.1.230.0040.00719.15
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0030.00517.13
8.1.180.0080.00018.10
8.1.170.0040.00418.54
8.1.160.0040.00422.00
8.1.150.0040.00418.50
8.1.140.0040.00417.38
8.1.130.0000.00717.88
8.1.120.0000.00817.37
8.1.110.0050.00317.35
8.1.100.0000.00717.46
8.1.90.0030.00517.41
8.1.80.0030.00317.41
8.1.70.0030.00317.40
8.1.60.0080.00017.56
8.1.50.0050.00317.41
8.1.40.0040.00417.42
8.1.30.0080.00017.61
8.1.20.0040.00417.63
8.1.10.0000.00717.63
8.1.00.0030.00517.54
8.0.300.0000.00718.77
8.0.290.0070.00017.30
8.0.280.0000.00718.42
8.0.270.0030.00317.16
8.0.260.0070.00017.24
8.0.250.0000.00717.00
8.0.240.0000.00817.04
8.0.230.0040.00416.96
8.0.220.0000.00816.90
8.0.210.0040.00416.83
8.0.200.0030.00317.02
8.0.190.0030.00616.90
8.0.180.0040.00416.93
8.0.170.0040.00416.86
8.0.160.0000.00816.92
8.0.150.0050.00216.92
8.0.140.0040.00416.93
8.0.130.0070.00013.37
8.0.120.0000.00716.87
8.0.110.0040.00416.88
8.0.100.0050.00217.00
8.0.90.0040.00416.94
8.0.80.0160.00316.92
8.0.70.0040.00416.98
8.0.60.0050.00216.89
8.0.50.0000.00716.92
8.0.30.0100.00917.21
8.0.20.0100.00917.40
8.0.10.0030.00316.97
8.0.00.0080.01316.88
7.4.330.0030.00315.00
7.4.320.0000.00616.50
7.4.300.0030.00316.54
7.4.290.0040.00316.46
7.4.280.0040.00416.52
7.4.270.0080.00016.48
7.4.260.0030.00616.49
7.4.250.0080.00016.46
7.4.240.0020.00516.56
7.4.230.0070.00016.59
7.4.220.0090.00916.60
7.4.210.0100.00416.56
7.4.200.0080.00016.69
7.4.190.0050.00316.40
7.4.160.0060.00916.77
7.4.150.0030.01417.40
7.4.140.0110.00817.86
7.4.130.0110.00816.63
7.4.120.0060.01216.56
7.4.110.0110.00716.48
7.4.100.0240.00016.48
7.4.90.0080.00816.51
7.4.80.0030.01319.39
7.4.70.0070.01016.41
7.4.60.0030.01716.48
7.4.50.0040.00016.58
7.4.40.0120.00616.55
7.4.30.0110.01116.41
7.4.00.0040.01115.16
7.3.330.0030.00313.35
7.3.320.0020.00213.21
7.3.310.0030.00516.38
7.3.300.0000.00716.29
7.3.290.0070.00716.36
7.3.280.0090.00916.37
7.3.270.0080.00817.40
7.3.260.0070.01016.44
7.3.250.0070.01016.62
7.3.240.0180.01216.31
7.3.230.0120.00616.52
7.3.210.0070.01016.30
7.3.200.0140.00319.39
7.3.190.0090.00916.27
7.3.180.0070.00716.52
7.3.170.0100.00616.43
7.3.160.0080.00816.47
7.3.120.0130.00315.05
7.2.330.0090.00916.61
7.2.320.0160.00616.66
7.2.310.0030.01316.68
7.2.300.0090.01516.52
7.2.290.0060.01316.32
7.2.60.0030.01316.67
7.2.00.0000.01419.25
7.1.200.0000.01415.32
7.1.100.0040.00817.84
7.1.70.0070.00016.88
7.1.60.0060.01819.46
7.1.50.0060.01916.86
7.1.00.0070.07322.37
7.0.200.0030.00716.63
7.0.140.0100.06722.22
7.0.60.0000.08319.93
7.0.50.0100.03317.89
7.0.40.0070.04720.25
7.0.30.0230.04320.11
7.0.20.0300.08020.21
7.0.10.0400.07320.15
7.0.00.0070.08720.09
5.6.280.0030.07020.88
5.6.210.0130.07320.48
5.6.200.0070.03718.13
5.6.190.0070.08020.55
5.6.180.3300.04020.47
5.6.170.0330.07720.62
5.6.160.0030.07720.50
5.6.150.0070.04318.18
5.6.140.0030.04018.18
5.6.130.0070.05018.14
5.6.120.0030.04021.16
5.6.110.0070.08321.04
5.6.100.0130.07321.12
5.6.90.0030.08021.01
5.6.80.0130.03720.40
5.5.350.0230.07320.41
5.5.340.0200.06318.05
5.5.330.0100.03720.37
5.5.320.0330.06720.34
5.5.310.0300.04720.30
5.5.300.0030.04317.98
5.5.290.0030.05317.93
5.5.280.0070.05020.81
5.5.270.0030.05020.77
5.5.260.0130.07720.88
5.5.250.0070.05020.70
5.5.240.0230.07020.20
5.4.450.0100.05719.36
5.4.440.0930.05719.54
5.4.430.0370.05719.32
5.4.420.0630.00019.34
5.4.410.0230.05018.96
5.4.400.0130.07018.82
5.4.390.0200.07718.55
5.4.380.0200.05718.60
5.4.370.0070.04018.62
5.4.360.0100.03718.75
5.4.350.0140.06512.03
5.4.340.0030.04912.02
5.4.320.0110.03912.52
5.4.310.0050.04512.52
5.4.300.0060.05312.52
5.4.290.0130.05312.52
5.4.280.0100.03912.41
5.4.270.0070.03812.42
5.4.260.0060.04812.42
5.4.250.0090.03812.41
5.4.240.0090.03712.42
5.4.230.0050.04012.40
5.4.220.0060.04712.40
5.4.210.0060.03912.41
5.4.200.0070.03912.41
5.4.190.0050.04112.40
5.4.180.0040.04012.40
5.4.170.0080.03612.41
5.4.160.0090.03912.41
5.4.150.0070.03712.40
5.4.140.0080.03612.09
5.4.130.0100.03312.08
5.4.120.0050.03712.03
5.4.110.0060.03612.03
5.4.100.0080.03212.03
5.4.90.0070.03512.03
5.4.80.0090.03412.03
5.4.70.0030.03812.02
5.4.60.0060.03512.02
5.4.50.0050.03712.02
5.4.40.0100.03312.01
5.4.30.0050.03712.00
5.4.20.0050.04412.01
5.4.10.0060.04912.01
5.4.00.0070.05011.50
5.3.290.0040.04012.80
5.3.280.0100.05012.71
5.3.270.0060.04012.73
5.3.260.0070.05312.72
5.3.250.0070.04612.72
5.3.240.0060.03512.72
5.3.230.0070.03612.71
5.3.220.0070.03612.68
5.3.210.0070.03812.68
5.3.200.0050.04312.68
5.3.190.0050.03912.67
5.3.180.0070.04112.67
5.3.170.0080.03612.67
5.3.160.0090.03612.68
5.3.150.0110.04812.68
5.3.140.0050.05312.66
5.3.130.0090.05112.66
5.3.120.0090.05012.66
5.3.110.0060.04212.66
5.3.100.0060.03612.13
5.3.90.0060.03712.11
5.3.80.0070.03512.11
5.3.70.0100.03212.11
5.3.60.0050.03912.09
5.3.50.0090.03312.04
5.3.40.0080.03612.04
5.3.30.0080.03312.00
5.3.20.0110.03111.78
5.3.10.0060.03711.74
5.3.00.0140.02911.73
5.2.170.0070.0339.24
5.2.160.0040.0429.24
5.2.150.0070.0409.23
5.2.140.0080.0389.23
5.2.130.0050.0389.19
5.2.120.0070.0319.20
5.2.110.0060.0289.20
5.2.100.0130.0219.19
5.2.90.0130.0229.19
5.2.80.0070.0299.19
5.2.70.0060.0299.19
5.2.60.0040.0319.14
5.2.50.0050.0309.11
5.2.40.0070.0309.09
5.2.30.0050.0289.06
5.2.20.0090.0249.05
5.2.10.0070.0288.96
5.2.00.0040.0338.82
5.1.60.0010.0288.11
5.1.50.0070.0228.10
5.1.40.0030.0268.09
5.1.30.0040.0298.43
5.1.20.0020.0318.45
5.1.10.0040.0298.18
5.1.00.0060.0268.18
5.0.50.0020.0236.66
5.0.40.0060.0216.52
5.0.30.0030.0346.34
5.0.20.0020.0226.30
5.0.10.0020.0226.28
5.0.00.0060.0296.27
4.4.90.0030.0164.78
4.4.80.0010.0184.75
4.4.70.0050.0144.75
4.4.60.0040.0154.76
4.4.50.0050.0134.77
4.4.40.0020.0264.71
4.4.30.0040.0144.76
4.4.20.0010.0184.85
4.4.10.0010.0184.85
4.4.00.0060.0304.76
4.3.110.0040.0184.67
4.3.100.0040.0204.66
4.3.90.0050.0204.63
4.3.80.0050.0344.59
4.3.70.0050.0214.63
4.3.60.0040.0224.63
4.3.50.0030.0234.63
4.3.40.0030.0334.54
4.3.30.0040.0213.31
4.3.20.0040.0213.28
4.3.10.0030.0213.24
4.3.00.0170.0207.57

preferences:
44.37 ms | 400 KiB | 5 Q