3v4l.org

run code in 300+ PHP versions simultaneously
<?php //this code will append a &mobileapp to every https://example.com url and http://foobar.com url ob_start(); ?> <html> <head> </head> <body> <a href="http://foobar.com"> http://www.example.com/~hillybilly/foobar.php silly silly </body> </html> <?php $html = ob_get_clean(); $append = 'mobileapp'; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXpath($doc); $elements = $xpath->query('//*[@href | @src | @action]'); if (!is_null($elements)) { foreach ($elements as $element) { var_dump($element); switch ($element->nodeName) { case 'a': $element->setAttribute('href', $element->getAttribute('href') . '&' . $append); } } } echo $doc->saveHtml();

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.0040.01116.63
8.3.50.0140.00522.11
8.3.40.0040.01518.95
8.3.30.0070.00719.34
8.3.20.0080.00020.61
8.3.10.0030.00623.90
8.3.00.0040.00421.02
8.2.180.0130.01018.50
8.2.170.0060.00922.96
8.2.160.0070.00720.72
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0060.00319.51
8.2.110.0060.00322.75
8.2.100.0100.00318.28
8.2.90.0000.00819.47
8.2.80.0000.00917.97
8.2.70.0040.00417.88
8.2.60.0050.00518.27
8.2.50.0060.00318.07
8.2.40.0000.00820.38
8.2.30.0060.00318.58
8.2.20.0060.00317.93
8.2.10.0070.00018.49
8.2.00.0040.00419.84
8.1.280.0130.01025.92
8.1.270.0060.00324.21
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00624.20
8.1.230.0120.00019.53
8.1.220.0030.00618.05
8.1.210.0000.00818.77
8.1.200.0090.00017.47
8.1.190.0030.00517.50
8.1.180.0040.00418.10
8.1.170.0030.00618.82
8.1.160.0000.00822.30
8.1.150.0000.00718.93
8.1.140.0040.00417.79
8.1.130.0000.00818.07
8.1.120.0000.00717.87
8.1.110.0040.00417.80
8.1.100.0040.00417.84
8.1.90.0070.00017.85
8.1.80.0030.00617.83
8.1.70.0000.00717.78
8.1.60.0000.00817.83
8.1.50.0040.00417.93
8.1.40.0040.00417.87
8.1.30.0030.00617.88
8.1.20.0000.00817.91
8.1.10.0000.00817.86
8.1.00.0000.00817.82
8.0.300.0040.00418.77
8.0.290.0040.00417.13
8.0.280.0040.00418.66
8.0.270.0040.00417.60
8.0.260.0030.00317.63
8.0.250.0070.00017.18
8.0.240.0030.00717.15
8.0.230.0000.00717.30
8.0.220.0030.00317.14
8.0.210.0040.00417.20
8.0.200.0030.00317.29
8.0.190.0040.00417.28
8.0.180.0040.00417.29
8.0.170.0030.00617.07
8.0.160.0030.00317.21
8.0.150.0060.00317.10
8.0.140.0030.00617.24
8.0.130.0060.00013.64
8.0.120.0080.00017.13
8.0.110.0030.00517.27
8.0.100.0000.00817.27
8.0.90.0000.00717.30
8.0.80.0070.00717.20
8.0.70.0040.00417.15
8.0.60.0000.00817.04
8.0.50.0000.00717.16
8.0.30.0100.01217.46
8.0.20.0100.01117.51
8.0.10.0040.00417.42
8.0.00.0030.01517.02
7.4.330.0000.00515.47
7.4.320.0030.00316.84
7.4.300.0000.00616.92
7.4.290.0000.00816.75
7.4.280.0070.00416.75
7.4.270.0000.00716.84
7.4.260.0000.00816.81
7.4.250.0040.00416.86
7.4.240.0040.00416.90
7.4.230.0000.00716.96
7.4.220.0100.00716.92
7.4.210.0030.01616.85
7.4.200.0070.00016.86
7.4.160.0120.00616.69
7.4.150.0120.00617.40
7.4.140.0110.00717.86
7.4.130.0110.01116.85
7.4.120.0120.01016.74
7.4.110.0080.01216.96
7.4.100.0130.00716.82
7.4.90.0100.00716.75
7.4.80.0050.01419.39
7.4.70.0110.00616.93
7.4.60.0120.00616.82
7.4.50.0000.00416.67
7.4.40.0120.00616.87
7.4.30.0150.00716.89
7.4.00.0070.00915.15
7.3.330.0030.00313.40
7.3.320.0030.00313.35
7.3.310.0040.00416.66
7.3.300.0030.00316.63
7.3.290.0090.00616.58
7.3.280.0080.01216.59
7.3.270.0160.00317.40
7.3.260.0120.01217.08
7.3.250.0120.00916.77
7.3.240.0100.01016.90
7.3.230.0070.01816.95
7.3.210.0060.01916.76
7.3.200.0060.01519.39
7.3.190.0100.01016.56
7.3.180.0100.00716.78
7.3.170.0170.00316.82
7.3.160.0030.01416.78
7.3.120.0070.00914.93
7.3.110.0110.00414.67
7.3.100.0060.01014.88
7.3.90.0100.00314.61
7.3.80.0060.00915.02
7.3.70.0090.00315.14
7.3.60.0120.00614.86
7.3.50.0030.00714.86
7.3.40.0070.01014.81
7.3.30.0060.00314.88
7.3.20.0030.01416.88
7.3.10.0070.01016.50
7.3.00.0100.00716.48
7.2.330.0180.00617.04
7.2.320.0090.01217.19
7.2.310.0120.01217.15
7.2.300.0120.01216.79
7.2.290.0150.00817.04
7.2.250.0110.00715.42
7.2.240.0100.01015.41
7.2.230.0060.00615.38
7.2.220.0130.00314.96
7.2.210.0100.00715.04
7.2.200.0000.01915.09
7.2.190.0100.00715.00
7.2.180.0070.00315.09
7.2.170.0170.00015.30
7.2.130.0050.01216.74
7.2.120.0070.00916.53
7.2.110.0150.00616.76
7.2.100.0110.00616.63
7.2.90.0150.00216.70
7.2.80.0120.01116.84
7.2.70.0060.01316.81
7.2.60.0120.00816.80
7.2.50.0150.00616.59
7.2.40.0100.00817.13
7.2.30.0100.00916.93
7.2.20.0140.00316.83
7.2.10.0090.00716.70
7.2.00.0060.00717.87
7.1.330.0070.01015.94
7.1.320.0030.00915.88
7.1.310.0030.01416.01
7.1.300.0130.00315.86
7.1.290.0030.01415.82
7.1.280.0060.01015.89
7.1.270.0030.01316.18
7.1.260.0000.01515.93
7.1.250.0080.01115.66
7.1.200.0060.00616.07
7.1.100.0070.00718.19
7.1.70.0090.00017.28
7.1.60.0090.01619.70
7.1.50.0000.01717.08
7.1.00.0030.07722.47
7.0.200.0050.00216.71
7.0.140.0030.07322.16
7.0.80.0370.08020.06
7.0.70.0270.07720.12
7.0.60.0430.06020.25
7.0.50.0170.05020.49
7.0.40.0070.04720.21
7.0.30.0100.08720.23
7.0.20.0070.07720.16
7.0.10.0100.03720.25
7.0.00.0130.07320.20
5.6.280.0030.07321.13
5.6.230.0030.05020.70
5.6.220.0030.04320.92
5.6.210.0070.04320.88
5.6.200.0100.06021.23
5.6.190.0070.07021.27
5.6.180.0100.07321.27
5.6.170.0070.07721.29
5.6.160.0130.03721.21
5.6.150.0030.08721.23
5.6.140.0130.07021.13
5.6.130.0100.07721.29
5.6.120.0070.04721.25
5.6.110.0100.07721.20
5.6.100.0100.08021.19
5.6.90.0170.07321.24
5.6.80.0130.07020.56
5.6.70.0100.07720.57
5.6.60.0170.07020.57
5.6.50.0170.06320.64
5.6.40.0170.06720.51
5.6.30.0130.07020.66
5.6.20.0200.07320.52
5.6.10.0100.07720.56
5.6.00.0200.07020.59
5.5.370.0100.07320.53
5.5.360.0130.07720.45
5.5.350.0030.06020.57
5.5.340.0100.08020.99
5.5.330.0070.07020.97
5.5.320.0100.08021.05
5.5.310.0070.08321.05
5.5.300.0030.08321.06
5.5.290.0000.09021.03
5.5.280.0030.08020.95
5.5.270.0030.08021.03
5.5.260.0070.05321.00
5.5.250.0130.06320.81
5.5.240.0030.05020.39
5.5.230.0100.07020.32
5.5.220.0170.03320.34
5.5.210.0100.04720.39
5.5.200.0130.07720.39
5.5.190.0030.05720.40
5.5.180.0100.03720.31
5.5.160.0030.04720.38
5.5.150.0030.05320.29
5.5.140.0030.08020.36
5.5.130.0070.04020.35
5.5.120.0100.04320.27
5.5.110.0070.04020.38
5.5.100.0100.04020.26
5.5.90.0000.04720.16
5.5.80.0030.04020.31
5.5.70.0000.04320.21
5.5.60.0000.04320.27
5.5.50.0100.03320.25
5.5.40.0030.04020.28
5.5.30.0000.04320.27
5.5.20.0000.04020.20
5.5.10.0070.03020.14
5.5.00.0070.03720.21
5.4.450.0030.08019.50
5.4.440.0100.07319.50
5.4.430.0100.06019.59
5.4.420.0130.07719.33
5.4.410.0100.06719.45
5.4.400.0070.04319.02
5.4.390.0100.07719.19
5.4.380.0130.07019.18
5.4.370.0030.06319.16
5.4.360.0100.07319.18
5.4.350.0030.06019.05
5.4.340.0070.05019.23
5.4.320.0100.07319.25
5.4.310.0170.06019.21
5.4.300.0000.05719.18
5.4.290.0100.03319.23
5.4.280.0100.03319.26
5.4.270.0030.04019.24
5.4.260.0100.03319.16
5.4.250.0070.03318.98
5.4.240.0070.04018.98
5.4.230.0070.03019.16
5.4.220.0100.03019.22
5.4.210.0030.04019.20
5.4.200.0030.03719.25
5.4.190.0030.05319.08
5.4.180.0000.03719.28
5.4.170.0000.04019.24
5.4.160.0130.03019.27
5.4.150.0100.03319.18
5.4.140.0100.05716.26
5.4.130.0030.03016.61
5.4.120.0000.03316.54
5.4.110.0030.04016.68
5.4.100.0030.03016.60
5.4.90.0030.03316.57
5.4.80.0000.04716.64
5.4.70.0000.04716.49
5.4.60.0030.03716.50
5.4.50.0030.03716.60
5.4.40.0000.07716.40
5.4.30.0030.03716.49
5.4.20.0000.03716.49
5.4.10.0000.05316.49
5.4.00.0030.03315.98
5.3.290.0070.08014.83
5.3.280.0000.04014.73
5.3.270.0000.04714.72
5.3.260.0030.03714.74
5.3.250.0100.03014.75
5.3.240.0030.04314.77
5.3.230.0170.02314.61
5.3.220.0030.03714.72
5.3.210.0000.03714.68
5.3.200.0000.04014.73
5.3.190.0000.04314.72
5.3.180.0030.03314.73
5.3.170.0070.03714.72
5.3.160.0000.04014.62
5.3.150.0030.03714.72
5.3.140.0070.03014.58
5.3.130.0030.03714.69
5.3.120.0000.04014.70
5.3.110.0000.04014.70
5.3.100.0000.03714.20
5.3.90.0070.03314.13
5.3.80.0030.03714.17
5.3.70.0170.03014.02
5.3.60.0070.03314.15
5.3.50.0070.03714.09
5.3.40.0100.03013.95
5.3.30.0070.03314.02
5.3.20.0070.03313.85
5.3.10.0070.03313.80
5.3.00.0070.06713.79
5.2.170.0000.04313.54
5.2.160.0000.03013.54
5.2.150.0030.04013.54
5.2.140.0030.03013.54
5.2.130.0000.03713.54
5.2.120.0070.03013.54
5.2.110.0000.03013.54
5.2.100.0030.02713.54
5.2.90.0000.03013.54
5.2.80.0030.03013.54
5.2.70.0000.02713.54
5.2.60.0100.03013.54
5.2.50.0030.06013.54
5.2.40.0070.03313.54
5.2.30.0070.05713.54
5.2.20.0030.05013.54
5.2.10.0070.05713.54
5.2.00.0030.05313.54
5.1.60.0000.04313.54
5.1.50.0070.03713.54
5.1.40.0030.02313.54
5.1.30.0030.03013.54
5.1.20.0030.05313.54
5.1.10.0030.05713.54
5.1.00.0100.05713.54
5.0.50.0100.04013.54
5.0.40.0100.01313.54
5.0.30.0000.06013.54
5.0.20.0000.02713.54
5.0.10.0030.02713.54
5.0.00.0070.03313.54
4.4.90.0030.01313.54
4.4.80.0000.01713.54
4.4.70.0000.03313.54
4.4.60.0070.02713.54
4.4.50.0000.02713.54
4.4.40.0100.04713.54
4.4.30.0000.04013.54
4.4.20.0070.01313.54
4.4.10.0070.02013.54
4.4.00.0030.04313.54
4.3.110.0000.03713.54
4.3.100.0070.01713.54
4.3.90.0070.02313.54
4.3.80.0030.05013.54
4.3.70.0000.03313.54
4.3.60.0030.01713.54
4.3.50.0070.03013.54
4.3.40.0030.04713.54
4.3.30.0030.02013.54
4.3.20.0000.02713.54
4.3.10.0030.03313.54
4.3.00.0000.03313.54

preferences:
39.85 ms | 401 KiB | 5 Q