3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=1; while ($i<=5) { # code... $url = 'http://www.amazon.in/gp/bestsellers/electronics/ref=zg_bs_nav_0#'.$i; echo $url; $html= file_get_contents($url); $dom = new DOMDocument(); @$dom->loadHTML($html); $xPath = new DOMXPath($dom); $classname="zg_title"; $elements = $xPath->query("//*[contains(@class, '$classname')]"); foreach ($elements as $e) { $lnk = $e->getAttribute('href'); $e->setAttribute("href", "http://www.amazon.in".$lnk); $newdoc = new DOMDocument; $e = $newdoc->importNode($e, true); $newdoc->appendChild($e); $html = $newdoc->saveHTML(); echo $html; } $i++; } ?>

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.0090.00616.86
8.3.50.0170.00521.93
8.3.40.0080.00819.09
8.3.30.0070.00719.12
8.3.20.0000.00820.54
8.3.10.0050.00324.04
8.3.00.0080.00019.75
8.2.180.0090.00618.79
8.2.170.0140.00322.96
8.2.160.0070.01022.41
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0060.00317.88
8.2.110.0070.00321.36
8.2.100.0080.00418.29
8.2.90.0040.00419.38
8.2.80.0030.00617.97
8.2.70.0080.00017.63
8.2.60.0080.00018.17
8.2.50.0000.00818.07
8.2.40.0000.00821.12
8.2.30.0040.00420.92
8.2.20.0040.00417.90
8.2.10.0050.00218.48
8.2.00.0080.00018.19
8.1.280.0120.00825.92
8.1.270.0080.00024.21
8.1.260.0080.00026.35
8.1.250.0030.00728.09
8.1.240.0180.00021.63
8.1.230.0080.00321.29
8.1.220.0040.00417.93
8.1.210.0000.00818.77
8.1.200.0090.00017.60
8.1.190.0000.00817.46
8.1.180.0040.00418.10
8.1.170.0000.00819.16
8.1.160.0000.00822.30
8.1.150.0080.00019.15
8.1.140.0000.00819.73
8.1.130.0040.00418.04
8.1.120.0040.00417.58
8.1.110.0000.00817.61
8.1.100.0070.00017.58
8.1.90.0000.00717.71
8.1.80.0000.00717.63
8.1.70.0000.00717.64
8.1.60.0000.00817.79
8.1.50.0030.00617.80
8.1.40.0040.00417.66
8.1.30.0050.00317.81
8.1.20.0000.00817.91
8.1.10.0040.00417.69
8.1.00.0060.00317.66
8.0.300.0000.00718.77
8.0.290.0040.00417.13
8.0.280.0030.00318.78
8.0.270.0000.00717.44
8.0.260.0000.00717.60
8.0.250.0070.00017.10
8.0.240.0060.00317.15
8.0.230.0000.00717.30
8.0.220.0030.00317.16
8.0.210.0000.00717.20
8.0.200.0030.00317.11
8.0.190.0070.00417.24
8.0.180.0040.00417.13
8.0.170.0080.00017.05
8.0.160.0050.00217.11
8.0.150.0000.00717.12
8.0.140.0050.00317.21
8.0.130.0000.00613.70
8.0.120.0030.00717.25
8.0.110.0080.00017.17
8.0.100.0040.00417.19
8.0.90.0040.00417.36
8.0.80.0090.00917.22
8.0.70.0050.00217.21
8.0.60.0040.00417.31
8.0.50.0060.00317.23
8.0.30.0090.01017.53
8.0.20.0120.00917.48
8.0.10.0080.00017.14
8.0.00.0120.00616.99
7.4.330.0000.00515.61
7.4.320.0030.00616.86
7.4.300.0050.00216.91
7.4.290.0020.00516.92
7.4.280.0030.00616.86
7.4.270.0030.00316.82
7.4.260.0030.00616.93
7.4.250.0030.00617.08
7.4.240.0040.00417.09
7.4.230.0040.00416.84
7.4.220.0080.01216.95
7.4.210.0070.01317.12
7.4.200.0040.00416.91
7.4.160.0170.00316.85
7.4.150.0210.00417.40
7.4.140.0170.00617.86
7.4.130.0050.01417.05
7.4.120.0100.00917.00
7.4.110.0160.00317.08
7.4.100.0070.01417.06
7.4.90.0070.01416.94
7.4.80.0090.01019.39
7.4.70.0040.01316.93
7.4.60.0150.00316.87
7.4.50.0090.00016.93
7.4.40.0120.00617.03
7.4.30.0040.01616.97
7.4.00.0100.00915.35
7.3.330.0030.00313.90
7.3.320.0000.00513.68
7.3.310.0040.00416.79
7.3.300.0070.00016.88
7.3.290.0040.00416.82
7.3.280.0130.00616.92
7.3.270.0080.01217.40
7.3.260.0140.00616.85
7.3.240.0080.01516.78
7.3.230.0070.01317.13
7.3.210.0090.01216.85
7.3.200.0180.00416.76
7.3.190.0180.00416.75
7.3.180.0090.00916.75
7.3.170.0120.00616.92
7.3.160.0190.00017.10
7.3.120.0110.00515.40
7.3.110.0050.01415.27
7.3.100.0080.00915.04
7.3.90.0090.00915.43
7.3.80.0080.00615.09
7.3.70.0080.00815.05
7.3.60.0060.00815.26
7.3.50.0070.01015.32
7.3.40.0090.00415.18
7.3.30.0120.00415.12
7.3.20.0090.00916.99
7.3.10.0040.01117.14
7.3.00.0100.00516.93
7.2.330.0090.01217.18
7.2.320.0210.00616.99
7.2.310.0060.01317.01
7.2.300.0170.00317.11
7.2.290.0060.01416.88
7.2.250.0130.00515.52
7.2.240.0070.01315.43
7.2.230.0040.01415.54
7.2.220.0110.00515.28
7.2.210.0070.01215.45
7.2.200.0030.01315.26
7.2.190.0140.00315.39
7.2.180.0020.01615.52
7.2.170.0030.01515.19
7.2.60.0070.00717.15
7.2.00.0100.00320.04
7.1.330.0020.01316.35
7.1.320.0050.01116.27
7.1.310.0110.00616.32
7.1.300.0090.00716.16
7.1.290.0080.00816.31
7.1.280.0100.00516.25
7.1.270.0060.01016.21
7.1.260.0080.00816.14
7.1.200.0030.00915.90
7.1.100.0060.00618.51
7.1.70.0030.00617.45
7.1.60.0100.01419.43
7.1.50.0180.00617.57
7.1.00.0070.07022.86
7.0.200.0280.00715.09
7.0.60.0070.07020.53
7.0.50.0000.04718.20
7.0.40.0170.07720.58
7.0.30.0270.07720.73
7.0.20.0100.06020.60
7.0.10.0100.05720.57
7.0.00.0100.03720.64
5.6.280.0130.06021.37
5.6.210.0100.08020.92
5.6.200.0070.08018.89
5.6.190.0100.08021.11
5.6.180.0470.07721.00
5.6.170.0270.04721.04
5.6.160.0200.07320.93
5.6.150.0070.05318.70
5.6.140.0070.08318.64
5.6.130.0100.06018.80
5.6.120.0030.05321.60
5.6.110.0030.09021.37
5.6.100.0070.07321.48
5.6.90.0100.04021.36
5.6.80.0070.08021.02
5.5.350.0230.08320.96
5.5.340.0100.03718.46
5.5.330.0070.08020.85
5.5.320.0200.04320.81
5.5.310.0230.06720.80
5.5.300.0100.05018.61
5.5.290.0030.05718.52
5.5.280.0070.08721.35
5.5.270.0000.06021.39
5.5.260.0030.04021.39
5.5.250.0070.04021.21
5.5.240.0070.07320.63
5.4.450.0370.07020.21
5.4.440.0370.07020.05
5.4.430.0200.07020.08
5.4.420.0370.04720.11
5.4.410.0200.08019.78
5.4.400.0400.04719.88
5.4.390.0270.05719.59
5.4.380.0270.05719.64
5.4.370.0300.04719.76
5.4.360.0130.07719.53
5.4.350.0270.06319.63
5.4.340.0230.05719.57
5.4.320.0230.07719.52
5.4.310.0300.06019.64
5.4.300.0200.07019.57
5.4.290.0200.06019.62
5.4.280.0300.07319.60
5.4.270.0330.06019.64
5.4.260.0270.06719.70
5.4.250.0200.08319.63
5.4.240.0230.08019.88
5.4.230.0200.05719.79
5.4.220.0330.04719.72
5.4.210.0300.05719.58
5.4.200.0230.06719.59
5.4.190.0130.07319.52
5.4.180.0200.06019.47
5.4.170.0330.07319.79
5.4.160.0230.05019.48
5.4.150.0170.06319.62
5.4.140.0330.06017.01
5.4.130.0370.05717.02
5.4.120.0200.06317.04
5.4.110.0300.05316.92
5.4.100.0270.05316.96
5.4.90.0130.06317.04
5.4.80.0170.07317.02
5.4.70.0230.07716.96
5.4.60.0300.06317.23
5.4.50.0270.06016.89
5.4.40.0430.06017.03
5.4.30.0330.05317.08
5.4.20.0270.05017.00
5.4.10.0200.06717.22
5.4.00.0230.05016.58

preferences:
60.25 ms | 401 KiB | 5 Q