3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReadXml(string $xmlstr) { $xmlElement = simplexml_load_string($xmlstr); $return = ""; $return .= $xmlElement->getName(); foreach($xmlElement->children() as $key => $child) { $return .= $key.": ".$child."\n"; } return $return; } $xmlstr = '<Address><to>James</to><from>Jani</from><heading>Reminder</heading><body>Please check your mail.</body></Address>'; echo ReadXml($xmlstr);

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.97
8.3.50.0110.01022.18
8.3.40.0070.01118.70
8.3.30.0140.00019.29
8.3.20.0000.00820.60
8.3.10.0030.00523.78
8.3.00.0000.00822.61
8.2.180.0110.00818.26
8.2.170.0140.00722.96
8.2.160.0070.00720.83
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00422.42
8.2.110.0090.00022.27
8.2.100.0040.00818.09
8.2.90.0000.00819.52
8.2.80.0060.00318.18
8.2.70.0000.00817.88
8.2.60.0030.00518.28
8.2.50.0060.00618.07
8.2.40.0000.00818.59
8.2.30.0040.00418.33
8.2.20.0030.00517.74
8.2.10.0040.00418.01
8.2.00.0000.01017.85
8.1.280.0070.01425.92
8.1.270.0100.00623.87
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00423.98
8.1.230.0100.00319.27
8.1.220.0000.00817.90
8.1.210.0030.00618.77
8.1.200.0030.00917.36
8.1.190.0040.00417.65
8.1.180.0000.00918.10
8.1.170.0060.00318.84
8.1.160.0040.00422.16
8.1.150.0040.00418.90
8.1.140.0000.00717.64
8.1.130.0030.00318.09
8.1.120.0040.00417.63
8.1.110.0020.00517.71
8.1.100.0000.00717.52
8.1.90.0000.00717.55
8.1.80.0060.00317.54
8.1.70.0030.00317.58
8.1.60.0000.00817.77
8.1.50.0030.00617.67
8.1.40.0000.00717.69
8.1.30.0090.00017.76
8.1.20.0040.00417.82
8.1.10.0050.00217.71
8.1.00.0000.00817.48
8.0.300.0040.00418.77
8.0.290.0050.00217.29
8.0.280.0070.00018.57
8.0.270.0030.00317.51
8.0.260.0000.00617.02
8.0.250.0070.00017.04
8.0.240.0030.00517.19
8.0.230.0070.00017.14
8.0.220.0000.00716.99
8.0.210.0030.00317.07
8.0.200.0060.00017.03
8.0.190.0000.00717.14
8.0.180.0070.00017.04
8.0.170.0060.00317.03
8.0.160.0040.00417.01
8.0.150.0000.00716.85
8.0.140.0040.00417.07
8.0.130.0060.00013.61
8.0.120.0040.00416.94
8.0.110.0000.00917.00
8.0.100.0040.00417.15
8.0.90.0080.00017.04
8.0.80.0100.00717.07
8.0.70.0080.00017.12
8.0.60.0040.00416.88
8.0.50.0000.00717.09
8.0.30.0080.01317.39
8.0.20.0110.01117.42
8.0.10.0060.00317.24
8.0.00.0120.00816.99
7.4.330.0000.00515.24
7.4.320.0060.00016.68
7.4.300.0060.00016.65
7.4.290.0030.00316.81
7.4.280.0030.00316.70
7.4.270.0070.00016.77
7.4.260.0100.00016.68
7.4.250.0030.00616.80
7.4.240.0030.00416.74
7.4.230.0030.00316.50
7.4.220.0060.01216.89
7.4.210.0060.01016.79
7.4.200.0000.00716.69
7.4.190.0000.00816.88
7.4.160.0100.00716.68
7.4.150.0060.01217.40
7.4.140.0100.00917.86
7.4.130.0100.00816.61
7.4.120.0060.01216.76
7.4.110.0060.01216.81
7.4.100.0070.01016.54
7.4.90.0100.00716.66
7.4.80.0050.01419.39
7.4.70.0040.01216.71
7.4.60.0100.01316.63
7.4.50.0060.00316.57
7.4.40.0120.00322.77
7.4.30.0050.01416.68
7.4.00.0040.01214.73
7.3.330.0000.00513.43
7.3.320.0000.00513.42
7.3.310.0070.00016.48
7.3.300.0070.00016.49
7.3.290.0040.01116.46
7.3.280.0060.01216.47
7.3.270.0030.01417.40
7.3.260.0090.00916.65
7.3.250.0060.01016.70
7.3.240.0070.01016.60
7.3.230.0120.00816.57
7.3.210.0130.00416.61
7.3.200.0080.01619.39
7.3.190.0100.01016.71
7.3.180.0080.00816.59
7.3.170.0080.00716.61
7.3.160.0160.00016.66
7.3.120.0000.01415.04
7.2.330.0180.00016.88
7.2.320.0030.01316.78
7.2.310.0180.00616.68
7.2.300.0080.00916.96
7.2.290.0100.00716.82
7.2.60.0060.00617.34
7.2.50.0080.00617.08
7.1.200.0030.01015.75
7.1.70.0060.00617.27
7.1.60.0140.01019.29
7.1.50.0110.01517.19
7.1.00.0130.06722.52
7.0.200.0030.00616.59
7.0.140.0030.07322.08
7.0.60.0100.03720.11
7.0.50.0030.04717.94
7.0.40.0100.06720.15
7.0.30.0270.04020.20
7.0.20.0270.07720.29
7.0.10.0070.08020.40
7.0.00.0070.08320.28
5.6.280.0070.07020.77
5.6.210.0170.07720.67
5.6.200.0030.05018.29
5.6.190.0030.07320.57
5.6.180.0270.08020.68
5.6.170.0270.06320.71
5.6.160.0100.08320.61
5.6.150.0100.07018.21
5.6.140.0030.08318.15
5.6.130.0000.07018.28
5.6.120.0100.05721.14
5.6.110.0170.06321.00
5.6.100.0130.07321.11
5.6.90.0000.08021.02
5.6.80.0030.07020.38
5.6.70.4300.03720.40
5.5.350.0100.07320.43
5.5.340.0130.07018.03
5.5.330.0030.08320.29
5.5.320.0230.04720.38
5.5.310.0300.07320.28
5.5.300.0230.04318.08
5.5.290.0130.04017.98
5.5.280.0030.04720.85
5.5.270.0030.08720.86
5.5.260.0070.08320.77
5.5.250.0000.08320.69
5.5.240.0030.07320.16
5.4.450.0970.03319.64
5.4.440.0930.06719.16
5.4.430.0730.04719.57
5.4.420.0400.04719.58
5.4.410.0630.07319.31
5.4.400.0630.05718.98
5.4.390.0100.07319.06
5.4.380.0270.04318.62
5.4.370.0070.05718.59
5.4.360.0230.04318.79
5.4.350.0100.05718.70
5.4.340.0130.05718.71
5.4.320.0070.04512.50
5.4.310.0090.04912.50
5.4.300.0060.03912.50
5.4.290.0060.04012.50
5.4.280.0090.04412.40
5.4.270.0100.05012.40
5.4.260.0050.04612.40
5.4.250.0040.04212.40
5.4.240.0120.04612.40
5.4.230.0060.04112.39
5.4.220.0170.04912.37
5.4.210.0230.03912.37
5.4.200.0190.04412.36
5.4.190.0240.03912.36
5.4.180.0210.04112.36
5.4.170.0130.05012.38
5.4.160.0150.04712.37
5.4.150.0180.04612.36
5.4.140.0200.04212.05
5.4.130.0150.04712.04
5.4.120.0180.04212.00
5.4.110.0150.04411.99
5.4.100.0160.04512.00
5.4.90.0180.04212.00
5.4.80.0170.04211.99
5.4.70.0240.03811.98
5.4.60.0130.04711.99
5.4.50.0200.04111.98
5.4.40.0190.04711.97
5.4.30.0160.04411.97
5.4.20.0230.04311.97
5.4.10.0150.04911.97
5.4.00.0160.04211.46
5.3.290.0080.04612.80
5.3.280.0060.03912.71
5.3.270.0170.05112.72
5.3.260.0210.04812.72
5.3.250.0200.04412.72
5.3.240.0180.04912.72
5.3.230.0100.05912.71
5.3.220.0180.04712.68
5.3.210.0240.04412.68
5.3.200.0190.05012.68
5.3.190.0190.04812.67
5.3.180.0220.04712.68
5.3.170.0260.04012.67
5.3.160.0250.04712.67
5.3.150.0200.05312.67
5.3.140.0220.04312.66
5.3.130.0170.04712.66
5.3.120.0150.05012.66
5.3.110.0180.04812.66
5.3.100.0180.04612.11
5.3.90.0210.04412.09
5.3.80.0160.04712.07
5.3.70.0250.04612.07
5.3.60.0210.04812.06
5.3.50.0140.05612.00
5.3.40.0240.04812.00
5.3.30.0200.05111.97
5.3.20.0250.04711.75
5.3.10.0230.04811.71
5.3.00.0460.09111.69
5.2.170.0200.0329.20
5.2.160.0130.0419.20
5.2.150.0440.1029.19
5.2.140.0130.0409.19
5.2.130.0150.0359.15
5.2.120.0180.0359.16
5.2.110.0340.0789.16
5.2.100.0160.0349.16
5.2.90.0160.0369.16
5.2.80.0160.0369.15
5.2.70.0150.0359.15
5.2.60.0140.0359.10
5.2.50.0140.0369.07
5.2.40.0110.0399.05
5.2.30.0200.0319.03
5.2.20.0180.0329.02
5.2.10.0170.0308.92
5.2.00.0120.0348.78
5.1.60.0100.0308.06
5.1.50.0150.0268.06
5.1.40.0090.0318.05
5.1.30.0130.0308.39
5.1.20.0120.0318.42
5.1.10.0150.0298.14
5.1.00.0130.0318.14
5.0.50.0120.0246.62
5.0.40.0060.0266.47
5.0.30.0100.0356.29
5.0.20.0120.0216.26
5.0.10.0150.0176.23
5.0.00.0100.0356.23
4.4.90.0070.0194.77
4.4.80.0080.0174.75
4.4.70.0070.0184.76
4.4.60.0060.0204.76
4.4.50.0070.0184.77
4.4.40.0090.0274.71
4.4.30.0050.0214.76
4.4.20.0100.0164.84
4.4.10.0060.0204.85
4.4.00.0110.0264.76
4.3.110.0090.0174.67
4.3.100.0070.0194.67
4.3.90.0100.0154.64
4.3.80.0090.0274.59
4.3.70.0100.0154.63
4.3.60.0070.0204.63
4.3.50.0090.0204.63
4.3.40.0100.0244.53
4.3.30.0060.0173.30
4.3.20.0040.0193.28
4.3.10.0050.0183.24
4.3.00.0070.01713.43

preferences:
40.7 ms | 401 KiB | 5 Q