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) { 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.01118.81
8.3.50.0130.00717.59
8.3.40.0120.00319.18
8.3.30.0150.00019.09
8.3.20.0050.00319.32
8.3.10.0030.00619.15
8.3.00.0030.00619.76
8.2.180.0140.00417.00
8.2.170.0120.00322.96
8.2.160.0070.00721.56
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00421.41
8.2.110.0100.00021.37
8.2.100.0070.00418.09
8.2.90.0030.00619.64
8.2.80.0050.00319.58
8.2.70.0030.00517.88
8.2.60.0070.00418.30
8.2.50.0070.00318.07
8.2.40.0090.00018.41
8.2.30.0040.00418.27
8.2.20.0040.00418.04
8.2.10.0000.00818.11
8.2.00.0000.00718.01
8.1.280.0140.00725.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00722.71
8.1.230.0040.00821.26
8.1.220.0000.00918.16
8.1.210.0040.00419.21
8.1.200.0040.00417.73
8.1.190.0080.00017.89
8.1.180.0040.00418.10
8.1.170.0000.00819.28
8.1.160.0080.00019.23
8.1.150.0000.00818.98
8.1.140.0040.00417.79
8.1.130.0000.00718.20
8.1.120.0080.00017.90
8.1.110.0040.00417.69
8.1.100.0000.00717.83
8.1.90.0040.00417.88
8.1.80.0000.00717.73
8.1.70.0000.00817.80
8.1.60.0080.00017.83
8.1.50.0030.00617.73
8.1.40.0040.00417.75
8.1.30.0040.00418.03
8.1.20.0040.00417.90
8.1.10.0040.00417.92
8.1.00.0000.00817.90
8.0.300.0020.00520.29
8.0.290.0000.00817.25
8.0.280.0000.00718.77
8.0.270.0040.00417.49
8.0.260.0030.00317.23
8.0.250.0040.00417.36
8.0.240.0040.00417.36
8.0.230.0070.00017.32
8.0.220.0030.00317.32
8.0.210.0040.00417.30
8.0.200.0030.00317.24
8.0.190.0040.00417.29
8.0.180.0030.00617.32
8.0.170.0040.00417.35
8.0.160.0000.00717.21
8.0.150.0030.00617.12
8.0.140.0080.00317.28
8.0.130.0000.00613.76
8.0.120.0050.00317.20
8.0.110.0040.00417.17
8.0.100.0040.00417.10
8.0.90.0040.00417.24
8.0.80.0120.00317.30
8.0.70.0040.00417.27
8.0.60.0000.00717.19
8.0.50.0050.00217.30
8.0.30.0070.01317.37
8.0.20.0160.01017.58
8.0.10.0050.00317.50
8.0.00.0060.01417.14
7.4.330.0030.00313.39
7.4.320.0000.00616.92
7.4.300.0000.00616.81
7.4.290.0100.00016.86
7.4.280.0040.00416.90
7.4.270.0000.00816.76
7.4.260.0000.00513.70
7.4.250.0030.00616.84
7.4.240.0020.00616.84
7.4.230.0070.00016.97
7.4.220.0170.00916.79
7.4.210.0060.00916.91
7.4.200.0040.00417.05
7.4.190.0000.00716.98
7.4.160.0160.00016.81
7.4.150.0060.01216.96
7.4.140.0060.01216.77
7.4.130.0080.01116.78
7.4.120.0080.00916.84
7.4.110.0140.01016.81
7.4.100.0120.00616.89
7.4.90.0110.00816.96
7.4.80.0110.00616.91
7.4.70.0110.01116.66
7.4.60.0060.01016.82
7.4.50.0090.00316.88
7.4.40.0070.00716.90
7.4.30.0110.00517.07
7.4.00.0040.01115.04
7.3.330.0060.00013.27
7.3.320.0000.00613.31
7.3.310.0000.00716.60
7.3.300.0070.00016.60
7.3.290.0080.00616.61
7.3.280.0090.01016.63
7.3.270.0060.01116.64
7.3.260.0160.00316.82
7.3.250.0110.00816.66
7.3.240.0070.01116.86
7.3.230.0120.00616.63
7.3.210.0070.01016.59
7.3.200.0110.00719.39
7.3.190.0030.01416.80
7.3.180.0090.00816.77
7.3.170.0030.02016.72
7.3.160.0150.00716.75
7.3.120.0060.00614.87
7.2.330.0030.01816.71
7.2.320.0080.01116.73
7.2.310.0180.00716.73
7.2.300.0070.01017.02
7.2.290.0130.00316.98
7.2.00.0130.00319.21
7.1.200.0030.00715.77
7.1.100.0050.00518.23
7.1.70.0050.00517.41
7.1.60.0090.01519.40
7.1.50.0190.00317.11
7.1.00.0070.03022.56
7.0.200.0030.00716.80
7.0.140.0070.06722.21
7.0.120.0000.06722.16
7.0.60.0100.04720.03
7.0.50.0100.03717.97
7.0.40.0070.07320.67
7.0.30.0070.08320.46
7.0.20.0170.08020.19
7.0.10.0070.08720.45
7.0.00.0030.08020.20
5.6.210.0170.07720.88
5.6.200.0070.04718.37
5.6.190.0130.06320.82
5.6.180.0130.07720.79
5.6.170.0100.08720.79
5.6.160.0030.04720.62
5.6.150.0070.06020.44
5.6.140.0030.08020.58
5.6.130.0030.09020.46
5.6.120.0070.07020.34
5.6.110.0100.06020.35
5.6.100.0100.08720.48
5.6.90.0070.04720.54
5.6.80.0070.06319.71
5.6.70.0130.07719.66
5.6.60.0070.07019.87
5.6.50.0030.06020.06
5.6.40.0170.07719.92
5.6.30.0030.06019.91
5.6.20.0100.06019.66
5.6.10.0000.05019.68
5.6.00.0030.07019.84
5.5.350.0070.08320.60
5.5.340.0030.08318.29
5.5.330.0130.08020.41
5.5.320.0100.08320.62
5.5.310.0070.05320.59
5.5.300.0030.09020.29
5.5.290.0070.08320.29
5.5.280.0100.08020.39
5.5.270.0100.03720.36
5.5.260.0100.05720.38
5.5.250.0170.03020.08
5.5.240.0100.06719.64
5.5.230.0100.05019.76
5.5.220.0170.07719.70
5.5.210.0100.06719.65
5.5.200.0130.07019.48
5.5.190.0130.07319.47
5.5.180.0200.05319.72
5.5.160.0070.06719.65
5.5.150.0030.04019.60
5.5.140.0000.05319.49
5.5.130.0130.07319.66
5.5.120.0030.04319.58
5.5.110.0070.08319.59
5.5.100.0070.04019.55
5.5.90.0030.05319.57
5.5.80.0100.08019.55
5.5.70.0070.04019.37
5.5.60.0170.07719.64
5.5.50.0070.06019.52
5.5.40.0070.07319.62
5.5.30.0000.04319.50
5.5.20.0030.04019.58
5.5.10.0100.04319.58
5.5.00.0070.04019.43
5.4.450.0100.07319.63
5.4.440.0130.07719.63
5.4.430.0070.04019.63
5.4.420.0070.06019.40
5.4.410.0030.05719.43
5.4.400.0070.04319.34
5.4.390.0030.08019.20
5.4.380.0070.08019.30
5.4.370.0070.06019.24
5.4.360.0100.06719.16
5.4.350.0130.07019.30
5.4.340.0070.06019.29
5.4.320.0030.04019.30
5.4.310.0000.04019.20
5.4.300.0100.07019.33
5.4.290.0100.07319.13
5.4.280.0070.05719.30
5.4.270.0130.07719.27
5.4.260.0130.05019.23
5.4.250.0030.05019.18
5.4.240.0030.05319.07
5.4.230.0070.04719.07
5.4.220.0100.04719.32
5.4.210.0070.04319.07
5.4.200.0030.04019.29
5.4.190.0170.03019.39
5.4.180.0070.03319.12
5.4.170.0070.07319.35
5.4.160.0130.07019.29
5.4.150.0070.05319.29
5.4.140.0070.05016.60
5.4.130.0000.04716.81
5.4.120.0100.05716.60
5.4.110.0000.05016.57
5.4.100.0000.04316.56
5.4.90.0070.07316.66
5.4.80.0130.06316.54
5.4.70.0070.07016.64
5.4.60.0130.06716.64
5.4.50.0030.07716.56
5.4.40.0100.05716.54
5.4.30.0000.07716.60
5.4.20.0070.05716.64
5.4.10.0000.04016.64
5.4.00.0100.05016.11
5.3.290.0100.04714.87
5.3.280.0030.05714.78
5.3.270.0070.07014.77
5.3.260.0100.07014.79
5.3.250.0030.07714.75
5.3.240.0170.05714.82
5.3.230.0030.04014.75
5.3.220.0030.03714.73
5.3.210.0000.06314.88
5.3.200.0100.03714.73
5.3.190.0130.07014.73
5.3.180.0070.05314.70
5.3.170.0070.05014.71
5.3.160.0170.06714.78
5.3.150.0030.07714.77
5.3.140.0000.08314.67
5.3.130.0100.07314.73
5.3.120.0030.04714.72
5.3.110.0030.04014.75
5.3.100.0130.07314.20
5.3.90.0070.06014.20
5.3.80.0070.03714.21
5.3.70.0100.07314.22
5.3.60.0070.06314.06
5.3.50.0100.07314.18
5.3.40.0030.05714.15
5.3.30.0030.03714.12
5.3.20.0070.05013.86
5.3.10.0030.03713.71
5.3.00.0030.03713.79
5.2.170.0070.03711.20
5.2.160.0030.03011.25
5.2.150.0030.03711.36
5.2.140.0070.04311.36
5.2.130.0070.03311.25
5.2.120.0100.03311.25
5.2.110.0030.02711.30
5.2.100.0030.04711.17
5.2.90.0030.05311.14
5.2.80.0030.06011.25
5.2.70.0070.05311.30
5.2.60.0030.06311.10
5.2.50.0030.04711.17
5.2.40.0030.05311.19
5.2.30.0070.05311.18
5.2.20.0070.04311.12
5.2.10.0100.06011.01
5.2.00.0000.06310.93
5.1.60.0070.04010.14
5.1.50.0000.06010.16
5.1.40.0000.04710.19
5.1.30.0100.04710.65
5.1.20.0030.04010.39
5.1.10.0100.05010.21
5.1.00.0100.05310.23
5.0.50.0100.0208.71
5.0.40.0030.0438.61
5.0.30.0100.0578.44
5.0.20.0130.0278.40
5.0.10.0000.0478.40
5.0.00.0030.0638.32
4.4.90.0030.0237.41
4.4.80.0000.0277.41
4.4.70.0000.0337.41
4.4.60.0000.0377.41
4.4.50.0000.0377.41
4.4.40.0000.0337.41
4.4.30.0000.0377.41
4.4.20.0000.0407.41
4.4.10.0000.0237.41
4.4.00.0100.0437.41
4.3.110.0070.0337.41
4.3.100.0000.0337.41
4.3.90.0000.0277.41
4.3.80.0070.0337.41
4.3.70.0000.0377.41
4.3.60.0000.0237.41
4.3.50.0000.0207.41
4.3.40.0030.0507.41
4.3.30.0030.0277.41
4.3.20.0070.0277.41
4.3.10.0000.0277.41
4.3.00.0000.0377.41

preferences:
51.09 ms | 401 KiB | 5 Q