3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<'EOD' aaa <a href="link.php?x=banana">text 1</a> bbb <a href="different_url.php">text 2</a> ccc <a href="link.php?x=orange">text 3</a> ddd EOD; $dom = new DOMDocument; $dom->loadHTML('<div id="root">' . $html . '</div>'); $nodeList = $dom->getElementsByTagName('a'); foreach($nodeList as $link) { $query = parse_url($link->getAttribute('href'), PHP_URL_QUERY); if ( !$query ) continue; parse_str($query, $arr); if ( isset($arr['x']) ) $link->parentNode->insertBefore($dom->createTextNode($arr['x'] . ' '), $link); } $result = ''; foreach($dom->getElementById('root')->childNodes as $childNode) { $result .= $dom->saveHTML($childNode); } echo $result;

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.4.120.0110.00322.64
8.4.110.0130.00719.14
8.4.100.0120.01018.05
8.4.90.0170.00517.79
8.4.80.0070.00918.08
8.4.70.0070.00917.85
8.4.60.0110.01218.91
8.4.50.0090.01018.82
8.4.40.0100.01019.59
8.4.30.0060.00919.82
8.4.20.0060.00319.96
8.4.10.0090.00019.91
8.3.250.0100.00619.14
8.3.240.0090.01016.69
8.3.230.0090.01017.18
8.3.220.0110.00716.84
8.3.210.0110.00816.70
8.3.200.0030.00616.77
8.3.190.0030.00517.61
8.3.180.0100.00919.30
8.3.170.0100.01016.60
8.3.160.0080.00017.52
8.3.150.0150.00417.53
8.3.140.0000.00818.57
8.3.130.0050.00318.74
8.3.120.0060.00319.11
8.3.110.0050.00520.94
8.3.100.0080.00024.06
8.3.90.0060.00326.77
8.3.80.0040.00416.75
8.3.70.0120.00318.68
8.3.60.0160.00618.65
8.3.50.0130.00716.70
8.3.40.0120.00318.84
8.3.30.0070.00718.97
8.3.20.0040.00420.52
8.3.10.0040.00422.17
8.3.00.0000.00819.79
8.2.290.0080.00319.17
8.2.280.0120.00716.74
8.2.270.0070.01320.25
8.2.260.0060.00916.75
8.2.250.0130.00718.75
8.2.240.0060.00319.07
8.2.230.0130.00722.58
8.2.220.0090.00037.54
8.2.210.0080.00026.77
8.2.200.0100.00017.13
8.2.190.0160.00616.75
8.2.180.0130.00917.00
8.2.170.0110.00322.96
8.2.160.0100.00319.54
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00320.79
8.2.120.0040.00426.35
8.2.110.0050.00521.31
8.2.100.0090.00318.16
8.2.90.0000.00818.09
8.2.80.0040.00418.18
8.2.70.0080.00017.88
8.2.60.0050.00317.75
8.2.50.0030.00517.72
8.2.40.0050.00320.32
8.2.30.0000.00719.67
8.2.20.0040.00418.24
8.2.10.0000.00718.28
8.2.00.0060.00318.33
8.1.330.0120.00617.04
8.1.320.0110.00816.61
8.1.310.0110.00416.41
8.1.300.0040.00420.58
8.1.290.0140.00018.88
8.1.280.0060.01225.92
8.1.270.0050.00322.31
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0050.00522.72
8.1.230.0060.00620.98
8.1.220.0080.00417.90
8.1.210.0050.00319.09
8.1.200.0000.00817.48
8.1.190.0000.00817.48
8.1.180.0060.00318.10
8.1.170.0000.00919.25
8.1.160.0000.00719.13
8.1.150.0040.00419.06
8.1.140.0030.00519.68
8.1.130.0000.00717.71
8.1.120.0000.00717.80
8.1.110.0020.00517.68
8.1.100.0040.00417.68
8.1.90.0040.00417.70
8.1.80.0040.00417.78
8.1.70.0030.00517.68
8.1.60.0000.00917.86
8.1.50.0060.00317.78
8.1.40.0030.00517.73
8.1.30.0040.00417.97
8.1.20.0040.00417.88
8.1.10.0040.00417.84
8.1.00.0030.00517.65
8.0.300.0000.00920.15
8.0.290.0060.00317.00
8.0.280.0040.00418.69
8.0.270.0050.00317.09
8.0.260.0070.00017.15
8.0.250.0070.00017.16
8.0.240.0040.00417.24
8.0.230.0040.00417.27
8.0.220.0030.00317.16
8.0.210.0000.00717.22
8.0.200.0040.00417.26
8.0.190.0050.00317.22
8.0.180.0030.00417.29
8.0.170.0030.00317.20
8.0.160.0070.00317.32
8.0.150.0040.00417.10
8.0.140.0070.00017.17
8.0.130.0030.00313.61
8.0.120.0000.00817.05
8.0.110.0080.00017.11
8.0.100.0050.00217.11
8.0.90.0000.00717.21
8.0.80.0120.00317.20
8.0.70.0040.00417.05
8.0.60.0040.00417.09
8.0.50.0030.00516.94
8.0.30.0130.00717.42
8.0.20.0120.00817.40
8.0.10.0030.00317.19
8.0.00.0040.01816.95
7.4.330.0020.00215.55
7.4.320.0000.00616.93
7.4.300.0000.00616.73
7.4.290.0070.00016.80
7.4.280.0030.00616.72
7.4.270.0000.00716.79
7.4.260.0000.00716.87
7.4.250.0030.00316.77
7.4.240.0000.00816.92
7.4.230.0000.00716.95
7.4.220.0070.01716.71
7.4.210.0120.00316.84
7.4.200.0000.00716.88
7.4.160.0100.00416.61
7.4.150.0180.00017.40
7.4.140.0110.00717.86
7.4.130.0000.00017.01
7.4.120.0140.00716.63
7.4.110.0090.00716.73
7.4.100.0100.00616.80
7.4.90.0120.00616.73
7.4.80.0090.01519.39
7.4.70.0120.00616.89
7.4.60.0120.00916.73
7.4.50.0040.01516.77
7.4.40.0070.01016.96
7.4.30.0120.00416.86
7.4.00.0050.00914.91
7.3.330.0000.00613.47
7.3.320.0060.00013.37
7.3.310.0030.00316.63
7.3.300.0000.00716.49
7.3.290.0040.01016.64
7.3.280.0070.00916.64
7.3.270.0000.01717.40
7.3.260.0080.00816.78
7.3.250.0150.00916.63
7.3.240.0100.00716.72
7.3.230.0060.00916.89
7.3.210.0130.00316.90
7.3.200.0100.01016.69
7.3.190.0160.00316.90
7.3.180.0130.00316.75
7.3.170.0120.00916.75
7.3.160.0040.01216.74
7.3.120.0110.00715.11
7.3.110.0060.01215.01
7.3.100.0040.01214.61
7.3.90.0000.01215.17
7.3.80.0030.01314.97
7.3.70.0040.00814.97
7.3.60.0030.01414.80
7.3.50.0040.01114.76
7.3.40.0110.00715.04
7.3.30.0090.00614.77
7.3.20.0000.01616.82
7.3.10.0070.00716.62
7.3.00.0060.00616.79
7.2.330.0270.00616.93
7.2.320.0070.01116.96
7.2.310.0070.01016.85
7.2.300.0090.01317.09
7.2.290.0060.01016.84
7.2.250.0090.00915.06
7.2.240.0000.02015.04
7.2.230.0070.00714.89
7.2.220.0000.00915.12
7.2.210.0060.00615.11
7.2.200.0060.00915.23
7.2.190.0000.01015.20
7.2.180.0070.00315.16
7.2.170.0100.01015.28
7.2.80.0070.00416.96
7.2.60.0000.01117.20
7.1.330.0070.00715.87
7.1.320.0060.00315.99
7.1.310.0000.00915.79
7.1.300.0030.00915.84
7.1.290.0060.00615.68
7.1.280.0060.00915.91
7.1.270.0060.01015.96
7.1.260.0030.00715.92
7.1.200.0080.00416.02
7.1.80.4810.01016.29
7.1.70.6370.01415.52
7.1.60.5520.01633.41
7.1.50.6380.01733.03
7.1.40.5520.01732.69
7.1.30.7500.01332.82
7.1.20.5730.01732.84
7.1.10.5280.01014.99
7.1.00.6070.01614.93
7.0.200.7880.01014.87
7.0.190.7610.01415.11
7.0.180.5700.00714.37
7.0.170.7450.00314.51
7.0.160.8780.01014.57
7.0.150.5680.01514.48
7.0.140.4980.01014.63
7.0.130.5540.01014.82
7.0.120.5370.01214.99
7.0.110.6400.01314.57
7.0.100.5920.00314.58
7.0.90.5910.00714.79
7.0.80.5720.01014.89
7.0.70.5530.00714.56
7.0.60.6410.01314.58
7.0.50.5500.01814.66
7.0.40.5450.01714.82
7.0.30.5250.00714.94
7.0.20.5000.01214.70
7.0.10.5450.01614.68
7.0.00.5540.00714.63

preferences:
27.35 ms | 403 KiB | 5 Q