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($buffer); $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.70.0110.01116.58
8.3.60.0070.00718.42
8.3.50.0140.00721.14
8.3.40.0070.00718.92
8.3.30.0000.01420.17
8.3.20.0070.00020.21
8.3.10.0040.00421.95
8.3.00.0040.00422.46
8.2.180.0100.01316.73
8.2.170.0070.01422.96
8.2.160.0110.00422.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0040.00421.20
8.2.110.0070.00322.07
8.2.100.0000.01217.66
8.2.90.0040.00419.15
8.2.80.0050.00219.34
8.2.70.0040.00417.50
8.2.60.0030.00618.05
8.2.50.0060.00318.07
8.2.40.0020.00518.22
8.2.30.0050.00519.45
8.2.20.0050.00317.58
8.2.10.0000.00817.88
8.2.00.0070.00017.75
8.1.280.0100.01025.92
8.1.270.0000.00723.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00622.14
8.1.230.0060.00622.77
8.1.220.0070.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0030.00617.53
8.1.180.0030.00619.14
8.1.170.0030.00618.43
8.1.160.0000.00818.79
8.1.150.0030.00618.64
8.1.140.0050.00217.35
8.1.130.0040.00417.79
8.1.120.0050.00217.46
8.1.110.0040.00317.37
8.1.100.0040.00417.44
8.1.90.0040.00417.43
8.1.80.0080.00017.41
8.1.70.0030.00317.36
8.1.60.0030.00617.51
8.1.50.0070.00017.52
8.1.40.0000.00717.49
8.1.30.0000.00917.64
8.1.20.0040.00417.56
8.1.10.0000.00717.68
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0050.00217.04
8.0.280.0030.00318.53
8.0.270.0030.00317.21
8.0.260.0040.00417.02
8.0.250.0030.00417.01
8.0.240.0000.00817.00
8.0.230.0030.00317.03
8.0.220.0000.00816.92
8.0.210.0070.00016.91
8.0.200.0000.00616.98
8.0.190.0040.00416.88
8.0.180.0000.00716.92
8.0.170.0000.00716.90
8.0.160.0040.00416.95
8.0.150.0050.00316.86
8.0.140.0000.00716.86
8.0.130.0060.00413.35
8.0.120.0000.00816.90
8.0.110.0070.00016.84
8.0.100.0050.00216.77
8.0.90.0000.00716.94
8.0.80.0120.00316.95
8.0.70.0040.00416.96
8.0.60.0040.00417.00
8.0.50.0070.00017.02
8.0.30.0110.00716.95
8.0.20.0070.01117.40
8.0.10.0000.00816.82
8.0.00.0100.01016.86
7.4.330.0000.00515.00
7.4.320.0020.00516.75
7.4.300.0030.00316.84
7.4.290.0030.00316.86
7.4.280.0040.00416.72
7.4.270.0080.00016.77
7.4.260.0000.00713.52
7.4.250.0000.00816.93
7.4.240.0000.00716.83
7.4.230.0000.00716.64
7.4.220.0070.01316.68
7.4.210.0080.00816.79
7.4.200.0040.00416.56
7.4.190.0080.00016.62
7.4.160.0120.00316.55
7.4.150.0150.00317.40
7.4.140.0100.00817.86
7.4.130.0120.00716.88
7.4.120.0070.01116.88
7.4.110.0120.01216.70
7.4.100.0090.00916.70
7.4.90.0070.01317.03
7.4.80.0090.00919.39
7.4.70.0070.01116.83
7.4.60.0120.00616.82
7.4.50.0000.00916.57
7.4.40.0120.00622.77
7.4.30.0070.01016.59
7.4.00.0110.00615.27
7.3.330.0050.00013.41
7.3.320.0020.00213.52
7.3.310.0000.00716.49
7.3.300.0000.00716.50
7.3.290.0030.01616.52
7.3.280.0060.01016.48
7.3.270.0100.00617.40
7.3.260.0030.01416.62
7.3.250.0120.00516.67
7.3.240.0160.00616.78
7.3.230.0070.01016.49
7.3.210.0090.00916.71
7.3.200.0100.00719.39
7.3.190.0110.00716.46
7.3.180.0060.00916.76
7.3.170.0030.01416.76
7.3.160.0080.00816.78
7.3.120.0060.01114.79
7.3.110.0060.00714.79
7.3.100.0050.00714.92
7.3.90.0030.01314.80
7.3.80.0030.01214.96
7.3.70.0080.00414.65
7.3.60.0060.00514.84
7.3.50.0040.01114.92
7.3.40.0030.01214.98
7.3.30.0080.00814.80
7.3.20.0100.00516.61
7.3.10.0020.01016.66
7.3.00.0020.01016.74
7.2.330.0070.01116.75
7.2.320.0120.00616.64
7.2.310.0150.00216.86
7.2.300.0060.01016.75
7.2.290.0130.00316.75
7.2.250.0170.00315.21
7.2.240.0050.01115.15
7.2.230.0080.01015.18
7.2.220.0050.00915.13
7.2.210.0070.00715.00
7.2.200.0030.00915.15
7.2.190.0040.00814.90
7.2.180.0080.00615.15
7.2.170.0060.01015.14
7.2.160.0070.01114.85
7.2.150.0090.00616.92
7.2.140.0000.01716.92
7.2.130.0070.01016.86
7.2.120.0040.01416.88
7.2.110.0100.00716.63
7.2.100.0120.00616.84
7.2.90.0080.00416.69
7.2.80.0120.00317.06
7.2.70.0040.01416.81
7.2.60.0040.00816.88
7.2.50.0090.00616.94
7.2.40.0040.01417.13
7.2.30.0000.01317.06
7.2.20.0040.01116.94
7.2.10.0030.01117.09
7.2.00.0050.01018.26
7.1.330.0030.01015.84
7.1.320.0050.00715.80
7.1.310.0050.00415.83
7.1.300.0020.01315.94
7.1.290.0080.00815.78
7.1.280.0030.00815.82
7.1.270.0070.00515.93
7.1.260.0020.01215.91
7.1.250.0040.00715.89
7.1.200.0120.00615.83
7.1.100.0030.01217.79
7.1.70.0030.00517.35
7.1.60.0000.01317.45
7.1.50.0110.00017.06
7.1.00.0000.04022.45
7.0.200.0060.00916.94
7.0.140.0000.07722.20
7.0.100.0030.08320.02
7.0.90.0070.08720.19
7.0.80.0070.07020.16
7.0.70.0300.07720.20
7.0.60.0430.07320.23
7.0.50.0330.08020.33
7.0.40.0200.06720.21
7.0.30.0070.07020.25
7.0.20.0000.06020.09
7.0.10.0070.04720.09
7.0.00.0070.04020.27
5.6.280.0030.09321.13
5.6.250.0070.06020.83
5.6.240.0030.05020.73
5.6.230.0070.08720.71
5.6.220.0170.08320.85
5.6.210.0030.08320.75
5.6.200.0030.08721.23
5.6.190.0030.09021.23
5.6.180.0130.06721.22
5.6.170.0030.04321.21
5.6.160.0030.04321.19
5.6.150.0000.05021.27
5.6.140.0000.05321.22
5.6.130.0030.05721.20
5.6.120.0030.03321.23
5.6.110.0070.04321.21
5.6.100.0070.03721.05
5.6.90.0000.06021.09
5.6.80.0000.04020.67
5.6.70.0000.04320.60
5.6.60.0030.04320.57
5.6.50.0200.02320.64
5.6.40.0100.03720.45
5.6.30.0070.03720.56
5.6.20.0000.04320.58
5.6.10.0030.06320.64
5.6.00.0070.04720.53
5.5.380.0000.08720.56
5.5.370.0270.06320.57
5.5.360.0100.08720.67
5.5.350.0130.08020.55
5.5.340.0170.07321.03
5.5.330.0130.06320.96
5.5.320.0030.08321.03
5.5.310.0170.03720.91
5.5.300.0000.05721.03
5.5.290.0070.04320.85
5.5.280.0030.04321.01
5.5.270.0030.04720.97
5.5.260.0100.04321.01
5.5.250.0030.05020.73
5.5.240.0000.04720.41
5.5.230.0000.06720.40
5.5.220.0030.03720.23
5.5.210.0070.04020.38
5.5.200.0000.05020.36
5.5.190.0070.04020.34
5.5.180.0130.05320.30
5.5.160.0000.04720.36
5.5.150.0030.04020.20
5.5.140.0070.04020.30
5.5.130.0000.04320.37
5.5.120.0070.03720.29
5.5.110.0070.03320.29
5.5.100.0100.03320.16
5.5.90.0100.06320.18
5.5.80.0000.03720.19
5.5.70.0000.04320.28
5.5.60.0000.04720.27
5.5.50.0070.03320.20
5.5.40.0030.06020.18
5.5.30.0070.07320.21
5.5.20.0000.06720.14
5.5.10.0070.04720.23
5.5.00.0170.05320.09
5.4.450.0000.04319.55
5.4.440.0070.03719.53
5.4.430.0070.04319.50
5.4.420.0070.06019.36
5.4.410.0070.03319.36
5.4.400.0070.04319.14
5.4.390.0070.03319.38
5.4.380.0000.04719.12
5.4.370.0070.03319.05
5.4.360.0000.04019.30
5.4.350.0070.03319.05
5.4.340.0000.04019.08
5.4.320.0170.03319.20
5.4.310.0030.03319.19
5.4.300.0000.04019.09
5.4.290.0170.02319.17
5.4.280.0030.03719.32
5.4.270.0030.04019.17
5.4.260.0000.04019.08
5.4.250.0070.03719.19
5.4.240.0070.03719.16
5.4.230.0030.03719.20
5.4.220.0070.03719.18
5.4.210.0070.06719.32
5.4.200.0070.08019.33
5.4.190.0030.07319.16
5.4.180.0000.05319.07
5.4.170.0100.07319.11
5.4.160.0070.03319.18
5.4.150.0130.06319.02
5.4.140.0070.04016.32
5.4.130.0100.07016.64
5.4.120.0070.07016.60
5.4.110.0130.06716.64
5.4.100.0030.04316.71
5.4.90.0070.07016.54
5.4.80.0070.07016.66
5.4.70.0100.07016.51
5.4.60.0100.06316.59
5.4.50.0170.05016.50
5.4.40.0070.06016.57
5.4.30.0100.07316.60
5.4.20.0070.04316.52
5.4.10.0030.07316.48
5.4.00.0030.04015.99
5.3.290.0030.03714.87
5.3.280.0070.07714.80
5.3.270.0070.08014.68
5.3.260.0030.03714.61
5.3.250.0070.07714.75
5.3.240.0070.06014.77
5.3.230.0000.05014.71
5.3.220.0070.07314.77
5.3.210.0130.06714.76
5.3.200.0070.07014.69
5.3.190.0130.07314.68
5.3.180.0070.06314.56
5.3.170.0070.07314.56
5.3.160.0070.06714.75
5.3.150.0130.06314.76
5.3.140.0100.07714.77
5.3.130.0070.07314.70
5.3.120.0030.07714.70
5.3.110.0100.07014.74
5.3.100.0030.04714.25
5.3.90.0100.07014.20
5.3.80.0030.08014.12
5.3.70.0070.08014.21
5.3.60.0070.06714.20
5.3.50.0000.05314.01
5.3.40.0100.06714.05
5.3.30.0070.05714.08
5.3.20.0030.07313.91
5.3.10.0130.06713.73
5.3.00.0070.04313.73
5.2.170.0030.04712.30
5.2.160.0070.05312.30
5.2.150.0070.06312.30
5.2.140.0030.05712.30
5.2.130.0030.04012.30
5.2.120.0100.06012.30
5.2.110.0030.06012.30
5.2.100.0030.06012.30
5.2.90.0000.06312.30
5.2.80.0130.05012.30
5.2.70.0070.04012.30
5.2.60.0130.05312.30
5.2.50.0030.06712.30
5.2.40.0030.03312.30
5.2.30.0070.05312.30
5.2.20.0070.06012.30
5.2.10.0100.02712.30
5.2.00.0000.05312.30
5.1.60.0100.03712.30
5.1.50.0030.04712.30
5.1.40.0070.02712.30
5.1.30.0030.06012.30
5.1.20.0030.04712.30
5.1.10.0070.03012.30
5.1.00.0070.04012.30
5.0.50.0030.02712.30
5.0.40.0030.04312.30
5.0.30.0100.05712.30
5.0.20.0030.04312.30
5.0.10.0030.03312.30
5.0.00.0070.05712.30
4.4.90.0000.03712.30
4.4.80.0030.03712.30
4.4.70.0030.02312.30
4.4.60.0000.03012.30
4.4.50.0070.03012.30
4.4.40.0030.05712.30
4.4.30.0070.03012.30
4.4.20.0030.02312.30
4.4.10.0000.02012.30
4.4.00.0000.05012.30
4.3.110.0030.03312.30
4.3.100.0000.03712.30
4.3.90.0070.03012.30
4.3.80.0000.05712.30
4.3.70.0030.03012.30
4.3.60.0070.03312.30
4.3.50.0030.03312.30
4.3.40.0000.04712.30
4.3.30.0000.03712.30
4.3.20.0000.03712.30
4.3.10.0030.03312.30
4.3.00.0030.03012.30

preferences:
41.6 ms | 401 KiB | 5 Q