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 OR @src OR @action]'); if (!is_null($elements)) { foreach ($elements as $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.0160.01018.93
8.3.50.0250.00521.45
8.3.40.0110.00719.25
8.3.30.0070.00720.72
8.3.20.0040.00420.89
8.3.10.0040.00422.51
8.3.00.0090.00022.95
8.2.180.0160.00616.73
8.2.170.0150.00322.96
8.2.160.0100.00722.62
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0100.01026.16
8.2.120.0040.00421.36
8.2.110.0060.00322.61
8.2.100.0060.00618.28
8.2.90.0060.00319.46
8.2.80.0040.00419.83
8.2.70.0040.00417.71
8.2.60.0050.00518.05
8.2.50.0060.00318.07
8.2.40.0000.00818.41
8.2.30.0030.00719.63
8.2.20.0040.00417.97
8.2.10.0000.00818.04
8.2.00.0030.00618.14
8.1.280.0060.00925.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00624.22
8.1.230.0060.00619.29
8.1.220.0050.00318.16
8.1.210.0080.00018.77
8.1.200.0030.00617.50
8.1.190.0000.00817.75
8.1.180.0040.00419.26
8.1.170.0040.00419.04
8.1.160.0070.00019.12
8.1.150.0050.00219.07
8.1.140.0040.00417.91
8.1.130.0030.00318.11
8.1.120.0000.00717.86
8.1.110.0040.00417.76
8.1.100.0040.00417.73
8.1.90.0040.00417.64
8.1.80.0000.00717.70
8.1.70.0070.00017.71
8.1.60.0040.00417.97
8.1.50.0080.00017.82
8.1.40.0000.00817.73
8.1.30.0040.00417.99
8.1.20.0090.00018.02
8.1.10.0030.00617.95
8.1.00.0040.00417.88
8.0.300.0040.00418.77
8.0.290.0050.00317.55
8.0.280.0030.00318.66
8.0.270.0000.00717.53
8.0.260.0000.00717.11
8.0.250.0070.00017.27
8.0.240.0000.00817.39
8.0.230.0040.00417.37
8.0.220.0050.00317.30
8.0.210.0050.00217.31
8.0.200.0000.00717.41
8.0.190.0000.00817.41
8.0.180.0000.00717.29
8.0.170.0000.00817.41
8.0.160.0030.00317.24
8.0.150.0000.00717.20
8.0.140.0030.00617.30
8.0.130.0070.00013.78
8.0.120.0040.00417.30
8.0.110.0050.00317.38
8.0.100.0050.00217.13
8.0.90.0050.00317.11
8.0.80.0180.00017.30
8.0.70.0000.00817.13
8.0.60.0000.00917.37
8.0.50.0040.00417.24
8.0.30.0110.00817.45
8.0.20.0120.00817.57
8.0.10.0040.00417.35
8.0.00.0110.01117.15
7.4.330.0000.00615.00
7.4.320.0000.00616.90
7.4.300.0030.00316.86
7.4.290.0000.00716.89
7.4.280.0030.00316.93
7.4.270.0030.00316.87
7.4.260.0070.00013.58
7.4.250.0040.00416.88
7.4.240.0000.00716.90
7.4.230.0050.00216.87
7.4.220.0090.00916.94
7.4.210.0100.00816.89
7.4.200.0080.00016.73
7.4.190.0000.00717.14
7.4.160.0030.01317.03
7.4.150.0120.00617.40
7.4.140.0070.01017.86
7.4.130.0100.01016.89
7.4.120.0090.00916.87
7.4.110.0100.00716.69
7.4.100.0170.00016.88
7.4.90.0090.00916.91
7.4.80.0100.01019.39
7.4.70.0090.01216.83
7.4.60.0110.00616.72
7.4.50.0090.00016.87
7.4.40.0000.01422.77
7.4.30.0000.01816.81
7.4.00.0000.01615.15
7.3.330.0050.00013.55
7.3.320.0050.00013.38
7.3.310.0080.00016.61
7.3.300.0040.00416.57
7.3.290.0100.00316.61
7.3.280.0060.01116.57
7.3.270.0110.00717.40
7.3.260.0130.00316.58
7.3.250.0080.01016.83
7.3.240.0090.00916.59
7.3.230.0080.00816.70
7.3.210.0110.00816.73
7.3.200.0130.00919.39
7.3.190.0160.00616.76
7.3.180.0100.00716.90
7.3.170.0120.00616.73
7.3.160.0080.00816.97
7.3.120.0000.01614.95
7.2.330.0140.00416.92
7.2.320.0030.01616.80
7.2.310.0100.00716.68
7.2.300.0110.00716.94
7.2.290.0030.01416.80
7.2.60.0120.00416.92
7.2.00.0040.01119.61
7.1.200.0040.01115.84
7.1.100.0070.00718.34
7.1.70.0000.00817.44
7.1.60.0150.01119.32
7.1.50.0050.00517.13
7.1.00.0100.05322.55
7.0.200.0030.00516.71
7.0.140.0030.07722.18
7.0.100.0230.07320.15
7.0.90.0130.08020.09
7.0.80.0130.07319.98
7.0.70.0030.06320.22
7.0.60.0070.08320.24
7.0.50.0100.07720.30
7.0.40.0030.08020.30
7.0.30.0130.07320.26
7.0.20.0070.08320.21
7.0.10.0100.07720.20
7.0.00.0200.06320.20
5.6.280.0000.10021.15
5.6.250.0130.07320.78
5.6.240.0030.06020.74
5.6.230.0070.08720.74
5.6.220.0070.08020.73
5.6.210.0130.07320.79
5.6.200.0130.07721.07
5.6.190.0070.08721.14
5.6.180.0030.08721.24
5.6.170.0070.08721.12
5.6.160.0070.05021.13
5.6.150.0100.07721.25
5.6.140.0100.04721.22
5.6.130.0130.07721.18
5.6.120.0130.06321.29
5.6.110.0100.07021.20
5.6.100.0030.05021.21
5.6.90.0030.05321.18
5.6.80.0070.04720.64
5.6.70.0070.06320.58
5.6.60.0070.03720.48
5.6.50.0070.03720.63
5.6.40.0030.04020.51
5.6.30.0070.04020.59
5.6.20.0070.03720.46
5.6.10.0100.05720.60
5.6.00.0030.04320.58
5.5.380.0130.07720.63
5.5.370.0070.07320.60
5.5.360.0070.08320.67
5.5.350.0100.08020.58
5.5.340.0270.06021.02
5.5.330.0070.04721.00
5.5.320.0100.06720.89
5.5.310.0130.07321.01
5.5.300.0170.07721.04
5.5.290.0170.07321.05
5.5.280.0030.05021.00
5.5.270.0000.08320.93
5.5.260.0070.06720.75
5.5.250.0030.04320.84
5.5.240.0070.03720.40
5.5.230.0070.07020.39
5.5.220.0070.03720.38
5.5.210.0000.04320.40
5.5.200.0100.03020.41
5.5.190.0030.04020.36
5.5.180.0070.04720.29
5.5.160.0000.04320.39
5.5.150.0100.04020.36
5.5.140.0200.02020.39
5.5.130.0030.03720.39
5.5.120.0030.04320.11
5.5.110.0030.04320.36
5.5.100.0070.03320.26
5.5.90.0030.03720.27
5.5.80.0070.03720.21
5.5.70.0070.03320.10
5.5.60.0000.04320.23
5.5.50.0030.04020.27
5.5.40.0030.03720.19
5.5.30.0030.04020.23
5.5.20.0030.04020.21
5.5.10.0100.03320.21
5.5.00.0070.06720.18
5.4.450.0030.08019.70
5.4.440.0100.08019.54
5.4.430.0100.08019.59
5.4.420.0070.07719.51
5.4.410.0030.04319.47
5.4.400.0000.03719.38
5.4.390.0000.04019.30
5.4.380.0130.02719.35
5.4.370.0000.04019.17
5.4.360.0000.04019.27
5.4.350.0100.03019.09
5.4.340.0170.02719.35
5.4.320.0070.03719.20
5.4.310.0030.04319.11
5.4.300.0030.03719.30
5.4.290.0070.04319.08
5.4.280.0030.03719.16
5.4.270.0100.03319.11
5.4.260.0000.05019.04
5.4.250.0170.05719.18
5.4.240.0070.03319.23
5.4.230.0000.04319.16
5.4.220.0030.05319.10
5.4.210.0000.04719.21
5.4.200.0070.04719.31
5.4.190.0070.03319.28
5.4.180.0030.03719.20
5.4.170.0000.04019.34
5.4.160.0030.03319.07
5.4.150.0070.04019.15
5.4.140.0000.03716.58
5.4.130.0030.03716.64
5.4.120.0070.03316.61
5.4.110.0000.04016.60
5.4.100.0070.06016.74
5.4.90.0030.06316.57
5.4.80.0100.04316.57
5.4.70.0170.06016.57
5.4.60.0070.05716.58
5.4.50.0000.07716.55
5.4.40.0100.06716.51
5.4.30.0070.04016.64
5.4.20.0100.06316.67
5.4.10.0030.03716.56
5.4.00.0100.04316.02
5.3.290.0000.05014.89
5.3.280.0000.07014.77
5.3.270.0100.03714.80
5.3.260.0070.05714.76
5.3.250.0000.05014.83
5.3.240.0000.04714.70
5.3.230.0030.03714.79
5.3.220.0000.04014.73
5.3.210.0030.04314.77
5.3.200.0000.04014.78
5.3.190.0100.04714.73
5.3.180.0000.04314.81
5.3.170.0030.07314.73
5.3.160.0000.07714.73
5.3.150.0130.07014.63
5.3.140.0130.07014.62
5.3.130.0030.07014.75
5.3.120.0100.07014.77
5.3.110.0000.06314.75
5.3.100.0000.04014.23
5.3.90.0070.07014.21
5.3.80.0030.07014.11
5.3.70.0170.06014.22
5.3.60.0130.05714.22
5.3.50.0000.04314.06
5.3.40.0100.07014.17
5.3.30.0070.06014.13
5.3.20.0070.04013.94
5.3.10.0000.04713.74
5.3.00.0000.08013.80
5.2.170.0070.05711.21
5.2.160.0000.03311.38
5.2.150.0100.05711.36
5.2.140.0130.05011.22
5.2.130.0000.06311.32
5.2.120.0030.06011.27
5.2.110.0070.05711.22
5.2.100.0030.06311.32
5.2.90.0070.05711.27
5.2.80.0030.06011.26
5.2.70.0000.04311.30
5.2.60.0030.06711.27
5.2.50.0000.05011.19
5.2.40.0100.05711.21
5.2.30.0000.04311.19
5.2.20.0070.06011.14
5.2.10.0000.04311.05
5.2.00.0030.05010.96
5.1.60.0000.05310.20
5.1.50.0030.03010.19
5.1.40.0030.05310.07
5.1.30.0000.06010.42
5.1.20.0070.04710.61
5.1.10.0070.03310.27
5.1.00.0070.05010.05
5.0.50.0030.0438.80
5.0.40.0030.0438.65
5.0.30.0000.0638.64
5.0.20.0100.0378.64
5.0.10.0030.0438.64
5.0.00.0030.0678.64
4.4.90.0070.0308.64
4.4.80.0000.0338.64
4.4.70.0000.0378.64
4.4.60.0000.0238.64
4.4.50.0030.0338.64
4.4.40.0000.0408.64
4.4.30.0030.0378.64
4.4.20.0030.0338.64
4.4.10.0000.0278.64
4.4.00.0030.0538.64
4.3.110.0000.0208.64
4.3.100.0070.0338.64
4.3.90.0030.0278.64
4.3.80.0000.0508.64
4.3.70.0100.0108.64
4.3.60.0030.0378.64
4.3.50.0030.0178.64
4.3.40.0030.0408.64
4.3.30.0000.0208.64
4.3.20.0030.0308.64
4.3.10.0000.0238.64
4.3.00.0030.0178.64

preferences:
48.68 ms | 401 KiB | 5 Q