3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); function xml_encode($mixed, $DOMDocument=null) { if (is_null($DOMDocument)) { $DOMDocument =new DOMDocument; $DOMDocument->formatOutput = true; xml_encode($mixed, $DOMDocument); echo $DOMDocument->saveXML(); } else { if (is_array($mixed)) { $node = $DOMDocument->createElement('urlset', 'hello'); $DOMDocument->appendChild($node); } } } $data = array(); for ($x = 0; $x <= 10; $x++) { $data['urlset'][] = array( 'loc' => 'http://www.example.com/user', 'lastmod' => 'YYYY-MM-DD', 'changefreq' => 'monthly', 'priority' => 0.5 ); } header('Content-Type: application/xml'); echo xml_encode($data);

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.0070.00716.88
8.3.50.0120.00922.09
8.3.40.0030.01718.95
8.3.30.0000.01519.05
8.3.20.0040.00422.22
8.3.10.0040.00423.77
8.3.00.0030.00917.73
8.2.180.0140.00718.41
8.2.170.0070.01022.96
8.2.160.0030.01020.68
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0030.00520.08
8.2.110.0070.00321.30
8.2.100.0100.00617.95
8.2.90.0000.00818.00
8.2.80.0060.00317.97
8.2.70.0000.00818.05
8.2.60.0000.00818.05
8.2.50.0040.00418.18
8.2.40.0080.00020.82
8.2.30.0040.00418.32
8.2.20.0050.00317.86
8.2.10.0060.00318.26
8.2.00.0040.00418.25
8.1.280.0130.00725.92
8.1.270.0060.00322.27
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.30
8.1.230.0040.00719.34
8.1.220.0040.00418.04
8.1.210.0080.00018.77
8.1.200.0080.00017.48
8.1.190.0080.00017.48
8.1.180.0030.00618.10
8.1.170.0050.00518.45
8.1.160.0040.00419.05
8.1.150.0000.00718.87
8.1.140.0000.00817.47
8.1.130.0030.00317.97
8.1.120.0040.00417.49
8.1.110.0040.00417.53
8.1.100.0000.00717.54
8.1.90.0040.00417.54
8.1.80.0070.00017.60
8.1.70.0030.00317.61
8.1.60.0030.00617.76
8.1.50.0110.00017.72
8.1.40.0090.00317.64
8.1.30.0040.00417.74
8.1.20.0080.00017.84
8.1.10.0030.00617.69
8.1.00.0040.00417.67
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0080.00018.48
8.0.270.0030.00317.48
8.0.260.0060.00017.34
8.0.250.0000.00717.10
8.0.240.0000.00617.10
8.0.230.0000.00717.03
8.0.220.0030.00316.88
8.0.210.0070.00016.96
8.0.200.0000.00816.98
8.0.190.0040.00417.00
8.0.180.0050.00216.96
8.0.170.0060.00316.97
8.0.160.0000.00916.95
8.0.150.0000.00716.84
8.0.140.0070.00016.88
8.0.130.0030.00313.36
8.0.120.0030.00616.92
8.0.110.0070.00016.92
8.0.100.0060.00316.80
8.0.90.0000.00716.83
8.0.80.0110.00817.02
8.0.70.0000.00716.84
8.0.60.0000.00716.84
8.0.50.0040.00416.81
8.0.30.0130.00817.31
8.0.20.0080.01217.40
8.0.10.0000.00716.95
8.0.00.0100.00616.85
7.4.330.0000.00515.20
7.4.320.0030.00316.66
7.4.300.0000.00616.64
7.4.290.0070.00016.71
7.4.280.0000.00816.59
7.4.270.0070.00016.63
7.4.260.0030.00616.70
7.4.250.0070.00016.69
7.4.240.0000.00716.69
7.4.230.0020.00516.63
7.4.220.0110.00616.79
7.4.210.0130.00116.78
7.4.200.0030.00516.71
7.4.160.0090.00616.68
7.4.150.0070.01117.40
7.4.140.0080.01417.86
7.4.130.0110.00916.63
7.4.120.0020.01816.71
7.4.110.0120.00616.62
7.4.100.0130.00616.57
7.4.90.0070.01016.39
7.4.80.0060.01219.39
7.4.70.0070.01016.60
7.4.60.0060.01016.56
7.4.50.0080.00016.64
7.4.40.0060.01216.80
7.4.30.0100.01116.54
7.4.00.0090.00915.00
7.3.330.0000.00613.42
7.3.320.0100.00513.30
7.3.310.0050.00216.57
7.3.300.0070.00016.46
7.3.290.0030.00316.38
7.3.280.0090.01216.55
7.3.270.0140.00417.40
7.3.260.0100.00716.37
7.3.250.0120.00516.60
7.3.240.0070.01116.67
7.3.230.0170.00616.79
7.3.210.0130.00616.73
7.3.200.0120.00619.39
7.3.190.0100.00616.68
7.3.180.0100.00716.81
7.3.170.0110.00716.45
7.3.160.0070.01016.58
7.3.120.0040.01114.85
7.3.110.0060.01014.76
7.3.100.0040.00814.70
7.3.90.0040.00715.12
7.3.80.0140.00015.14
7.3.70.0000.01014.91
7.3.60.0000.01215.05
7.3.50.0030.01314.90
7.3.40.0030.01214.61
7.3.30.0040.01414.68
7.3.20.0090.00316.76
7.3.10.0080.00816.66
7.3.00.0060.00616.79
7.2.330.0100.01316.61
7.2.320.0120.00616.85
7.2.310.0140.00716.89
7.2.300.0030.01316.73
7.2.290.0100.01416.75
7.2.250.0120.00614.99
7.2.240.0040.01515.18
7.2.230.0060.00914.98
7.2.220.0060.00314.93
7.2.210.0030.01015.42
7.2.200.0080.00614.81
7.2.190.0040.00715.27
7.2.180.0130.00314.77
7.2.170.0030.01215.05
7.2.160.0030.01215.15
7.2.150.0060.01016.75
7.2.140.0100.00317.25
7.2.130.0080.00817.09
7.2.120.0090.00817.07
7.2.110.0070.01016.81
7.2.100.0000.01516.95
7.2.90.0060.00916.69
7.2.80.0030.01017.01
7.2.70.0080.00416.76
7.2.60.0040.00916.84
7.2.50.0070.00717.10
7.2.40.0130.00316.81
7.2.30.0030.00616.88
7.2.20.0030.01017.06
7.2.10.0000.00917.04
7.2.00.0080.00618.32
7.1.330.0060.01015.94
7.1.320.0000.01515.99
7.1.310.0060.00915.71
7.1.300.0030.01315.93
7.1.290.0100.00315.95
7.1.280.0000.01415.88
7.1.270.0060.00915.98
7.1.260.0080.00415.84
7.1.250.0030.00616.01
7.1.200.0050.00515.54
7.1.100.0080.00418.40
7.1.70.0000.00716.98
7.1.60.0120.00419.50
7.1.50.0130.01017.14
7.1.00.0100.07022.61
7.0.200.0000.01017.04
7.0.60.0130.07720.02
7.0.50.0030.04017.94
7.0.40.0070.06320.47
7.0.30.0370.04720.39
7.0.20.0300.07720.39
7.0.10.0070.09320.16
7.0.00.0100.08720.39
5.6.280.0100.06720.92
5.6.210.0030.04320.59
5.6.200.0200.06718.20
5.6.190.0100.05320.84
5.6.180.3300.04720.73
5.6.170.0200.04020.50
5.6.160.0070.08320.63
5.6.150.0070.08018.23
5.6.140.0100.06718.39
5.6.130.0100.07018.24
5.6.120.0070.05020.93
5.6.110.0030.08321.10
5.6.100.0100.09021.08
5.6.90.0030.05020.98
5.6.80.0000.04720.43
5.5.350.0000.08320.49
5.5.340.0170.07318.10
5.5.330.0030.08020.47
5.5.320.0500.06320.39
5.5.310.0130.05720.37
5.5.300.0100.07718.04
5.5.290.0070.03718.05
5.5.280.0070.07320.79
5.5.270.0100.04720.89
5.5.260.0170.06720.84
5.5.250.0000.04720.61
5.5.240.0070.06720.41
5.4.450.0130.04019.56
5.4.440.0070.04319.46
5.4.430.0130.06719.61
5.4.420.0030.06019.54
5.4.410.0030.06019.12
5.4.400.0200.05018.84
5.4.390.0070.06018.66
5.4.380.0070.06018.69
5.4.370.0230.05018.70
5.4.360.0200.05018.91
5.4.350.0170.05018.85
5.4.340.0170.04718.70
5.4.320.0070.06318.87
5.4.310.0230.04718.76
5.4.300.0130.05718.87
5.4.290.0230.04318.90
5.4.280.0170.05718.86
5.4.270.0300.04718.54
5.4.260.0170.05718.65
5.4.250.0100.06018.70
5.4.240.0100.06018.54
5.4.230.0030.06318.86
5.4.220.0200.04718.64
5.4.210.0070.06318.68
5.4.200.0030.06016.70
5.4.190.0100.05318.68
5.4.180.0130.05318.82
5.4.170.0170.05018.79
5.4.160.0170.04718.89
5.4.150.0170.05318.67
5.4.140.0100.05316.38
5.4.130.0170.04716.53
5.4.120.0070.05316.41
5.4.110.0100.05016.40
5.4.100.0100.05716.24
5.4.90.0170.05316.52
5.4.80.0100.05016.35
5.4.70.0070.06016.34
5.4.60.0030.05716.46
5.4.50.0100.05016.34
5.4.40.0230.04016.28
5.4.30.0100.05016.30
5.4.20.0130.05716.36
5.4.10.0130.04716.33
5.4.00.0130.04715.85
5.3.290.0200.04714.77
5.3.280.0130.05014.84
5.3.270.0070.06014.88
5.3.260.0130.05014.68
5.3.250.0070.05714.77
5.3.240.0070.05314.86
5.3.230.0000.06014.84
5.3.220.0100.05314.84
5.3.210.0030.06014.75
5.3.200.0230.03714.81
5.3.190.0070.05314.82
5.3.180.0200.05014.74
5.3.170.0200.04314.72
5.3.160.0030.06014.84
5.3.150.0070.06014.65
5.3.140.0130.07314.75
5.3.130.0030.06014.72
5.3.120.0000.06314.72
5.3.110.0030.06014.61
5.3.100.0170.04714.21
5.3.90.0130.04714.14
5.3.80.0100.06314.09
5.3.70.0030.07014.12
5.3.60.0130.05714.36
5.3.50.0070.05314.23
5.3.40.0070.05314.05
5.3.30.0100.05014.10
5.3.20.0130.04313.80
5.3.10.0100.05013.83
5.3.00.0130.05314.02
5.2.170.0100.04311.28
5.2.160.0100.04011.33
5.2.150.0170.05311.23
5.2.140.0130.05711.30
5.2.130.0070.04311.21
5.2.120.0130.03711.31
5.2.110.0070.04311.30
5.2.100.0030.04711.39
5.2.90.0100.05711.46
5.2.80.0030.05011.34
5.2.70.0170.04711.25
5.2.60.0130.05011.18
5.2.50.0030.06011.21
5.2.40.0130.04711.06
5.2.30.0100.04011.10
5.2.20.0130.04311.21
5.2.10.0030.04011.13
5.2.00.0170.03310.96
5.1.60.0030.03710.25
5.1.50.0130.02710.25
5.1.40.0070.03710.14
5.1.30.0000.04310.52
5.1.20.0130.05010.54
5.1.10.0030.04710.23
5.1.00.0030.04010.23
5.0.50.0100.0308.66
5.0.40.0030.0338.47
5.0.30.0100.0538.32
5.0.20.0130.0278.45
5.0.10.0070.0308.35
5.0.00.0030.0538.28
4.4.90.0070.0205.91
4.4.80.0000.0275.98
4.4.70.0000.0275.89
4.4.60.0000.0276.02
4.4.50.0030.0235.90
4.4.40.0000.0475.93
4.4.30.0070.0205.88
4.4.20.0100.0205.93
4.4.10.0070.0275.99
4.4.00.0000.0375.92
4.3.110.0000.0275.85
4.3.100.0000.0275.81
4.3.90.0000.0235.80
4.3.80.0000.0435.81
4.3.70.0030.0205.81
4.3.60.0000.0275.93
4.3.50.0030.0235.81
4.3.40.0130.0305.80
4.3.30.0070.0234.57
4.3.20.0030.0234.57
4.3.10.0070.0204.50
4.3.00.0000.01316.51

preferences:
61.82 ms | 401 KiB | 5 Q