3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xml2array($xml){ $xml = simplexml_load_string(utf8_encode($xml)); $json = json_encode($xml); return json_decode($json,TRUE); } $xml1 = " <Root> <mounts> <names> <it>B</it> </names> </mounts> </Root> "; $xml2 = " <Root> <mounts> <names> <it>A</it> </names> </mounts> <mounts> <names> <it>A</it> </names> </mounts> </Root> "; echo '<pre>'; $arr1 = xml2array($xml1); $arr2 = xml2array($xml2); var_dump($arr1); var_dump($arr2); ?>

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.00718.56
8.3.50.0110.00822.11
8.3.40.0170.00318.96
8.3.30.0140.00019.35
8.3.20.0040.00420.41
8.3.10.0080.00023.85
8.3.00.0040.00418.16
8.2.180.0090.00916.75
8.2.170.0070.00722.96
8.2.160.0110.00420.70
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0030.00526.16
8.2.120.0050.00321.16
8.2.110.0030.00622.31
8.2.100.0100.00517.97
8.2.90.0000.00819.30
8.2.80.0080.00017.97
8.2.70.0030.00617.75
8.2.60.0040.00418.18
8.2.50.0090.00018.07
8.2.40.0040.00419.64
8.2.30.0020.00818.24
8.2.20.0040.00417.89
8.2.10.0000.00818.11
8.2.00.0050.00317.96
8.1.280.0110.00725.92
8.1.270.0070.00324.21
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00024.02
8.1.230.0060.00619.24
8.1.220.0040.00417.91
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0050.00317.47
8.1.180.0030.01018.10
8.1.170.0080.00018.84
8.1.160.0050.00222.09
8.1.150.0020.00518.94
8.1.140.0080.00017.58
8.1.130.0040.00418.04
8.1.120.0040.00417.70
8.1.110.0050.00317.61
8.1.100.0000.00717.55
8.1.90.0000.00717.56
8.1.80.0000.00717.58
8.1.70.0000.00717.59
8.1.60.0040.00417.67
8.1.50.0050.00317.75
8.1.40.0040.00417.62
8.1.30.0030.00517.88
8.1.20.0040.00417.76
8.1.10.0040.00417.78
8.1.00.0040.00417.72
8.0.300.0040.00418.77
8.0.290.0080.00516.73
8.0.280.0000.00718.64
8.0.270.0040.00417.47
8.0.260.0000.00617.45
8.0.250.0050.00217.12
8.0.240.0060.00317.00
8.0.230.0000.00717.04
8.0.220.0000.00717.09
8.0.210.0030.00616.93
8.0.200.0030.00317.13
8.0.190.0030.00317.11
8.0.180.0030.00517.11
8.0.170.0030.00517.02
8.0.160.0040.00417.01
8.0.150.0000.00716.95
8.0.140.0030.00616.88
8.0.130.0030.00313.44
8.0.120.0060.00317.02
8.0.110.0050.00316.95
8.0.100.0040.00416.87
8.0.90.0020.00517.10
8.0.80.0090.00617.08
8.0.70.0000.00716.86
8.0.60.0020.00517.06
8.0.50.0040.00417.08
8.0.30.0100.01017.11
8.0.20.0190.00417.47
8.0.10.0040.00416.97
8.0.00.0100.01016.69
7.4.330.0060.00015.07
7.4.320.0040.00416.73
7.4.300.0060.00316.63
7.4.290.0000.00716.79
7.4.280.0050.00316.66
7.4.270.0070.00016.80
7.4.260.0030.00316.83
7.4.250.0070.00016.60
7.4.240.0040.00416.74
7.4.230.0000.00716.91
7.4.220.0090.00616.84
7.4.210.0120.00616.75
7.4.200.0000.00816.44
7.4.160.0100.00716.72
7.4.150.0170.00017.40
7.4.140.0050.01317.86
7.4.130.0080.01216.64
7.4.120.0080.00916.68
7.4.110.0130.00316.68
7.4.100.0090.00916.63
7.4.90.0040.01416.70
7.4.80.0140.00719.39
7.4.70.0160.00716.65
7.4.60.0130.00716.68
7.4.50.0000.00516.88
7.4.40.0120.00416.61
7.4.30.0060.00916.79
7.4.00.0100.00715.18
7.3.330.0040.00313.46
7.3.320.0000.00613.27
7.3.310.0070.00016.31
7.3.300.0000.00716.31
7.3.290.0060.00916.47
7.3.280.0090.00716.42
7.3.270.0040.01317.40
7.3.260.0070.01716.40
7.3.250.0080.00916.49
7.3.240.0040.01816.71
7.3.230.0030.01416.64
7.3.210.0110.00716.63
7.3.200.0030.01416.68
7.3.190.0070.01016.81
7.3.180.0060.00916.40
7.3.170.0070.01016.37
7.3.160.0090.00916.43
7.3.120.0120.00314.66
7.3.110.0060.00914.86
7.3.100.0080.00814.98
7.3.90.0030.01114.86
7.3.80.0070.01014.71
7.3.70.0090.00615.19
7.3.60.0060.01014.68
7.3.50.0070.01114.74
7.3.40.0100.00614.79
7.3.30.0040.00814.74
7.3.20.0070.01016.54
7.3.10.0070.00716.53
7.3.00.0090.00616.45
7.2.330.0040.01416.89
7.2.320.0090.01316.83
7.2.310.0060.01116.79
7.2.300.0090.00916.98
7.2.290.0090.00916.74
7.2.240.0100.00615.25
7.2.230.0030.01315.16
7.2.220.0070.00715.41
7.2.210.0150.00014.75
7.2.200.0090.00314.81
7.2.190.0040.01315.15
7.2.180.0000.01315.04
7.2.170.0110.00715.06
7.2.160.0030.01015.01
7.2.150.0090.00616.68
7.2.140.0030.01017.15
7.2.130.0080.00417.09
7.2.120.0130.00317.23
7.2.110.0070.01116.74
7.2.100.0040.01217.12
7.2.90.0100.00716.95
7.2.80.0000.01216.96
7.2.70.0090.00616.98
7.2.60.0110.00417.09
7.2.50.0000.01616.86
7.2.40.0030.01217.21
7.2.30.0030.00816.83
7.2.20.0030.01316.70
7.2.10.0060.01216.95
7.2.00.0060.00518.26
7.1.330.0080.00415.96
7.1.320.0000.01315.90
7.1.310.0000.01215.87
7.1.300.0110.00315.94
7.1.290.0030.00916.02
7.1.280.0070.01015.64
7.1.270.0090.00615.65
7.1.260.0060.00615.75
7.1.250.0120.00015.84
7.1.200.0100.00015.64
7.1.100.0040.00818.25
7.1.70.0000.01017.32
7.1.60.0040.01919.25
7.1.50.0120.01217.02
7.1.00.0070.07322.47
7.0.200.0040.00416.64
7.0.140.0000.07722.11
7.0.90.0430.08720.04
7.0.80.0230.08020.04
7.0.70.0200.06019.93
7.0.60.0500.08319.91
7.0.50.0100.07720.49
7.0.40.0130.04320.28
7.0.30.0070.07720.16
7.0.20.0130.04320.15
7.0.10.0030.05020.22
7.0.00.0070.05020.21
5.6.280.0030.07321.18
5.6.240.0070.09720.71
5.6.230.0030.04720.68
5.6.220.0000.07020.78
5.6.210.0070.07020.62
5.6.200.0030.09021.02
5.6.190.0100.08321.13
5.6.180.0100.08020.99
5.6.170.0070.05721.27
5.6.160.0130.07021.11
5.6.150.0170.06321.17
5.6.140.0100.08021.07
5.6.130.0030.08721.16
5.6.120.0130.04721.24
5.6.110.0000.09320.98
5.6.100.0100.06021.10
5.6.90.0100.05321.16
5.6.80.0100.07320.57
5.6.70.0000.07020.51
5.6.60.0070.04320.63
5.6.50.0030.04720.52
5.6.40.0070.04720.42
5.6.30.0130.07020.64
5.6.20.0100.04320.51
5.6.10.0130.06020.50
5.6.00.0100.07020.44
5.5.380.0100.06020.57
5.5.370.0100.07720.41
5.5.360.0100.08020.61
5.5.350.0030.08020.57
5.5.340.0070.04720.89
5.5.330.0070.07720.89
5.5.320.0100.05321.03
5.5.310.0130.07321.01
5.5.300.0070.05020.98
5.5.290.0100.07020.88
5.5.280.0130.07020.91
5.5.270.0070.08320.88
5.5.260.0030.05320.96
5.5.250.0070.08320.59
5.5.240.0230.06720.36
5.5.230.0000.07020.23
5.5.220.0070.04320.23
5.5.210.0000.05020.41
5.5.200.0100.07020.36
5.5.190.0030.08320.32
5.5.180.0070.08320.13
5.5.160.0070.04720.34
5.5.150.0070.08020.38
5.5.140.0070.05020.35
5.5.130.0030.07720.25
5.5.120.0100.05720.18
5.5.110.0070.08020.15
5.5.100.0000.05720.10
5.5.90.0030.08320.27
5.5.80.0070.07720.27
5.5.70.0070.07320.02
5.5.60.0030.06320.23
5.5.50.0070.07320.19
5.5.40.0070.06720.01
5.5.30.0030.08020.27
5.5.20.0130.04020.20
5.5.10.0100.06720.07
5.5.00.0100.06320.09
5.4.450.0170.03319.61
5.4.440.0030.04719.58
5.4.430.0070.07319.21
5.4.420.0070.07319.36
5.4.410.0030.07019.47
5.4.400.0100.07019.25
5.4.390.0230.06019.18
5.4.380.0030.07319.02
5.4.370.0100.07319.23
5.4.360.0170.06019.04
5.4.350.0030.04319.22
5.4.340.0100.07319.25
5.4.320.0100.06718.95
5.4.310.0170.06719.10
5.4.300.0130.05319.09
5.4.290.0170.06319.34
5.4.280.0130.07018.91
5.4.270.0030.08019.27
5.4.260.0030.07018.98
5.4.250.0100.04019.36
5.4.240.0030.05719.03
5.4.230.0130.07019.21
5.4.220.0070.04318.94
5.4.210.0100.05019.23
5.4.200.0100.03719.25
5.4.190.0030.04719.02
5.4.180.0000.08719.02
5.4.170.0100.04718.91
5.4.160.0100.07019.21
5.4.150.0070.07719.20
5.4.140.0100.06716.62
5.4.130.0070.05016.48
5.4.120.0070.07016.48
5.4.110.0070.07016.59
5.4.100.0030.04716.49
5.4.90.0130.06316.63
5.4.80.0070.05716.57
5.4.70.0100.06316.50
5.4.60.0070.04716.54
5.4.50.0100.04016.50
5.4.40.0100.06316.56
5.4.30.0000.04716.60
5.4.20.0030.08016.55
5.4.10.0070.06716.64
5.4.00.0100.06715.98
5.3.290.0030.06014.88
5.3.280.0100.06314.66
5.3.270.0070.06714.85
5.3.260.0030.07714.77
5.3.250.0100.04314.77
5.3.240.0100.07314.82
5.3.230.0130.06714.63
5.3.220.0100.04014.68
5.3.210.0100.07014.63
5.3.200.0100.05714.77
5.3.190.0070.08014.63
5.3.180.0070.04014.70
5.3.170.0130.06314.61
5.3.160.0130.06714.68
5.3.150.0030.07714.63
5.3.140.0130.04314.60
5.3.130.0100.06714.68
5.3.120.0070.05314.75
5.3.110.0170.03714.62
5.3.100.0130.06314.14
5.3.90.0070.07314.12
5.3.80.0100.04713.99
5.3.70.0070.04014.24
5.3.60.0070.07314.13
5.3.50.0100.07014.16
5.3.40.0030.08013.96
5.3.30.0070.05314.12
5.3.20.0030.04013.69
5.3.10.0000.05013.91
5.3.00.0100.06313.85
5.2.170.0070.06011.34
5.2.160.0030.06011.30
5.2.150.0030.04711.12
5.2.140.0070.02711.27
5.2.130.0100.05711.16
5.2.120.0070.02711.16
5.2.110.0000.03711.30
5.2.100.0030.05011.16
5.2.90.0030.04711.24
5.2.80.0030.05311.05
5.2.70.0000.04311.16
5.2.60.0070.02711.21
5.2.50.0000.03311.25
5.2.40.0030.02711.11
5.2.30.0100.03711.11
5.2.20.0030.02711.11
5.2.10.0030.05011.07
5.2.00.0100.05310.93
5.1.60.0000.03010.08
5.1.50.0000.04710.14
5.1.40.0030.04710.04
5.1.30.0030.05710.50
5.1.20.0030.05710.48
5.1.10.0000.03310.34
5.1.00.0030.05710.25
5.0.50.0070.0379.64
5.0.40.0030.0479.64
5.0.30.0030.0539.64
5.0.20.0030.0179.64
5.0.10.0030.0439.64
5.0.00.0000.0479.64
4.4.90.0000.0209.64
4.4.80.0000.0179.64
4.4.70.0030.0309.64
4.4.60.0000.0339.64
4.4.50.0030.0339.64
4.4.40.0030.0539.64
4.4.30.0030.0139.64
4.4.20.0030.0179.64
4.4.10.0000.0339.64
4.4.00.0000.0279.64
4.3.110.0070.0209.64
4.3.100.0030.0379.64
4.3.90.0030.0239.64
4.3.80.0000.0279.64
4.3.70.0000.0209.64
4.3.60.0030.0139.64
4.3.50.0000.0239.64
4.3.40.0000.0309.64
4.3.30.0000.0279.64
4.3.20.0000.0239.64
4.3.10.0000.0209.64
4.3.00.0000.0239.64

preferences:
51.02 ms | 401 KiB | 5 Q