3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <translations> <translation id="title"> <english name="name1" ad="ad1">Hello there, how are you?</english> <italian name="name2" ad="ad2">Ciao, come stai?</italian> </translation> <translation id="text2"> <english name="name3" ad="ad4">222Hello there, how are you?</english> <italian name="name3" ad="ad4">222Ciao, come stai?</italian> </translation> <translation id="text3"> <english name="name5" ad="ad5">333Hello there, how are you?</english> <italian name="name6" ad="ad6">333Ciao, come stai?</italian> </translation> </translations>'; $xml = new SimpleXMLElement($xml); //var_dump($xml->translation); //echo $xml->translations->translation->english['ad']; //echo $xml->translations->translation->italian['name']; foreach ($xml->translation as $element) { foreach($element as $key => $val) { echo $element['id']."{$key}: {$val}".PHP_EOL; } } $xml = simplexml_load_string($xml); $json = json_encode($xml); $array = json_decode($json,TRUE); var_dump($array);

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.40.0150.00619.11
8.3.30.0030.01019.42
8.3.20.0000.00720.69
8.3.10.0080.00023.86
8.3.00.0060.00319.75
8.2.170.0110.00422.96
8.2.160.0070.00720.64
8.2.150.0040.00424.18
8.2.140.0100.00024.66
8.2.130.0000.00926.16
8.2.120.0030.00622.61
8.2.110.0060.00322.54
8.2.100.0060.00618.00
8.2.90.0040.00419.46
8.2.80.0050.00317.97
8.2.70.0050.00317.88
8.2.60.0030.00518.41
8.2.50.0100.00018.07
8.2.40.0030.00520.32
8.2.30.0050.00218.31
8.2.20.0040.00418.13
8.2.10.0000.00818.41
8.2.00.0080.00018.06
8.1.270.0050.00324.04
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0030.00624.14
8.1.230.0060.00619.26
8.1.220.0040.00417.80
8.1.210.0050.00318.77
8.1.200.0030.00617.25
8.1.190.0090.00017.38
8.1.180.0080.00018.10
8.1.170.0060.00318.82
8.1.160.0000.00722.35
8.1.150.0030.00519.27
8.1.140.0000.00717.78
8.1.130.0030.00318.01
8.1.120.0000.00717.63
8.1.110.0040.00417.84
8.1.100.0040.00417.77
8.1.90.0030.00617.62
8.1.80.0030.00317.62
8.1.70.0000.00917.68
8.1.60.0090.00017.82
8.1.50.0030.00617.72
8.1.40.0040.00417.74
8.1.30.0040.00417.75
8.1.20.0050.00317.93
8.1.10.0050.00217.89
8.1.00.0040.00417.88
8.0.300.0000.00818.77
8.0.290.0000.00817.25
8.0.280.0030.00518.74
8.0.270.0000.00717.61
8.0.260.0000.00617.52
8.0.250.0040.00417.34
8.0.240.0000.00617.22
8.0.230.0030.00717.29
8.0.220.0000.00817.07
8.0.210.0040.00417.23
8.0.200.0000.00717.16
8.0.190.0050.00317.14
8.0.180.0000.00717.31
8.0.170.0020.00517.27
8.0.160.0040.00417.15
8.0.150.0030.00517.29
8.0.140.0040.00417.22
8.0.130.0060.00013.61
8.0.120.0000.00817.25
8.0.110.0080.00017.11
8.0.100.0040.00417.13
8.0.90.0030.00617.04
8.0.80.0230.00017.23
8.0.70.0040.00417.15
8.0.60.0070.00017.16
8.0.50.0030.00517.05
8.0.30.0100.01117.39
8.0.20.0120.00817.42
8.0.10.0000.00717.29
8.0.00.0080.01016.87
7.4.330.0050.00015.40
7.4.320.0030.00316.94
7.4.300.0040.00416.77
7.4.290.0000.00816.75
7.4.280.0050.00316.87
7.4.270.0030.00316.77
7.4.260.0070.00016.73
7.4.250.0000.00816.80
7.4.240.0030.00516.80
7.4.230.0000.00716.82
7.4.220.0070.01116.88
7.4.210.0070.00716.68
7.4.200.0070.00016.95
7.4.160.0060.00916.84
7.4.150.0160.00617.40
7.4.140.0120.00617.86
7.4.130.0180.00516.78
7.4.120.0090.00916.77
7.4.110.0080.00816.68
7.4.100.0110.01116.87
7.4.90.0060.01016.61
7.4.80.0060.01219.39
7.4.70.0140.00316.82
7.4.60.0120.00916.75
7.4.50.0050.00316.79
7.4.40.0120.00416.53
7.4.30.0050.01116.86
7.4.00.0080.01115.02
7.3.330.0030.00313.54
7.3.320.0000.00513.56
7.3.310.0030.00316.74
7.3.300.0070.00016.59
7.3.290.0080.00816.69
7.3.280.0100.01016.59
7.3.270.0090.00917.40
7.3.260.0210.00616.72
7.3.250.0060.01116.86
7.3.240.0120.00616.74
7.3.230.0060.01116.69
7.3.210.0080.01116.58
7.3.200.0100.01319.39
7.3.190.0070.01316.86
7.3.180.0030.01316.46
7.3.170.0130.00716.62
7.3.160.0100.00616.70
7.3.120.0100.01015.18
7.3.110.0060.01215.07
7.3.100.0130.00314.95
7.3.90.0030.01215.05
7.3.80.0030.01015.23
7.3.70.0100.00615.00
7.3.60.0040.01115.00
7.3.50.0030.01314.84
7.3.40.0070.01114.83
7.3.30.0030.01015.04
7.3.20.0070.00716.76
7.3.10.0030.00616.76
7.3.00.0120.00316.67
7.2.330.0090.00916.86
7.2.320.0120.00817.05
7.2.310.0080.00816.86
7.2.300.0060.01216.92
7.2.290.0140.01116.57
7.2.250.0090.00915.33
7.2.240.0040.01415.26
7.2.230.0070.01015.02
7.2.220.0090.00315.04
7.2.210.0070.01115.00
7.2.200.0080.00415.21
7.2.190.0030.00615.28
7.2.180.0070.00715.20
7.2.170.0040.01115.25
7.1.330.0000.01215.84
7.1.320.0060.00316.16
7.1.310.0060.01015.82
7.1.300.0060.00615.90
7.1.290.0100.00616.06
7.1.280.0090.00615.71
7.1.270.0000.01015.68
7.1.260.0060.00616.02
7.1.70.0030.01017.43
7.1.60.0100.01319.11
7.1.50.0140.01017.05
7.1.00.0030.07322.55
7.0.200.0000.01016.76
7.0.140.0000.07722.10
7.0.90.0600.04720.03
7.0.80.0470.07720.02
7.0.70.0370.05020.17
7.0.60.0670.06720.18
7.0.50.0670.06320.50
7.0.40.0170.07020.13
7.0.30.0100.07020.20
7.0.20.0070.08020.20
7.0.10.0030.08320.17
7.0.00.0030.08720.18
5.6.280.0000.07720.89
5.6.240.0030.04720.79
5.6.230.0070.08720.68
5.6.220.0130.07320.80
5.6.210.0100.07720.74
5.6.200.0130.08021.21
5.6.190.0100.04321.27
5.6.180.0130.04721.14
5.6.170.0070.07021.11
5.6.160.0030.08721.09
5.6.150.0100.08721.10
5.6.140.0000.08721.08
5.6.130.0070.08720.98
5.6.120.0070.04321.17
5.6.110.0100.03721.07
5.6.100.0070.05321.10
5.6.90.0130.07721.14
5.6.80.0030.08020.51
5.6.70.0100.08020.59
5.6.60.0000.08020.64
5.6.50.0000.06320.46
5.6.40.0070.04720.65
5.6.30.0030.09320.51
5.6.20.0000.08320.59
5.6.10.0100.04020.43
5.6.00.0130.06720.48
5.5.380.0030.08020.60
5.5.370.0070.04320.46
5.5.360.0100.07320.59
5.5.350.0130.05020.47
5.5.340.0100.07721.02
5.5.330.0070.07720.96
5.5.320.0100.04320.82
5.5.310.0130.06720.96
5.5.300.0070.04720.86
5.5.290.0070.04320.94
5.5.280.0070.07720.97
5.5.270.0100.05720.84
5.5.260.0030.08020.86
5.5.250.0070.06020.78
5.5.240.0070.07320.41
5.5.230.0100.07020.31
5.5.220.0070.07320.39
5.5.210.0070.07320.24
5.5.200.0070.05720.22
5.5.190.0100.05720.39
5.5.180.0030.08320.15
5.5.160.0070.06020.41
5.5.150.0030.08020.39
5.5.140.0030.05020.20
5.5.130.0130.06020.22
5.5.120.0100.06320.38
5.5.110.0130.07020.24
5.5.100.0230.05720.26
5.5.90.0070.06020.13
5.5.80.0100.03720.06
5.5.70.0000.04320.20
5.5.60.0000.08320.15
5.5.50.0130.04320.24
5.5.40.0070.07320.14
5.5.30.0070.04320.28
5.5.20.0070.07720.23
5.5.10.0070.07720.16
5.5.00.0030.05020.08
5.4.450.0100.04319.36
5.4.440.0170.06319.70
5.4.430.0100.07319.51
5.4.420.0070.07719.61
5.4.410.0170.05019.35
5.4.400.0070.07719.20
5.4.390.0000.05718.99
5.4.380.0030.08319.13
5.4.370.0100.07319.04
5.4.360.0070.04719.20
5.4.350.0100.07319.19
5.4.340.0100.04719.20
5.4.320.0070.03719.05
5.4.310.0100.07019.02
5.4.300.0070.04319.18
5.4.290.0100.07319.24
5.4.280.0000.08319.29
5.4.270.0070.08019.37
5.4.260.0070.08019.21
5.4.250.0170.06719.20
5.4.240.0030.04319.16
5.4.230.0100.03719.05
5.4.220.0170.07019.18
5.4.210.0130.05719.04
5.4.200.0030.08019.20
5.4.190.0100.06719.28
5.4.180.0070.07019.22
5.4.170.0070.08019.27
5.4.160.0130.07319.22
5.4.150.0070.07719.20
5.4.140.0030.04716.43
5.4.130.0130.06716.48
5.4.120.0100.03716.61
5.4.110.0030.05716.54
5.4.100.0030.04316.54
5.4.90.0070.04316.54
5.4.80.0130.07016.50
5.4.70.0130.06716.48
5.4.60.0100.04016.47
5.4.50.0030.07016.43
5.4.40.0100.07016.45
5.4.30.0030.07316.66
5.4.20.0130.06716.61
5.4.10.0030.07716.55
5.4.00.0130.06715.99
5.3.290.0030.07314.86
5.3.280.0130.06014.76
5.3.270.0130.07314.83
5.3.260.0070.07014.70
5.3.250.0030.07314.64
5.3.240.0070.07714.63
5.3.230.0070.04314.80
5.3.220.0130.05714.77
5.3.210.0030.07714.71
5.3.200.0000.04714.70
5.3.190.0100.07714.76
5.3.180.0100.06714.71
5.3.170.0000.08314.68
5.3.160.0100.07314.62
5.3.150.0130.07014.61
5.3.140.0000.06714.57
5.3.130.0130.07014.75
5.3.120.0130.07014.56
5.3.110.0070.04314.69
5.3.100.0030.06314.21
5.3.90.0130.06014.16
5.3.80.0100.04714.14
5.3.70.0000.04314.16
5.3.60.0030.04313.97
5.3.50.0030.04014.06
5.3.40.0030.07014.16
5.3.30.0070.06014.07
5.3.20.0000.04013.83
5.3.10.0000.06013.64
5.3.00.0070.06713.64
5.2.170.0030.04011.31
5.2.160.0100.05711.34
5.2.150.0070.06311.28
5.2.140.0030.03711.11
5.2.130.0100.05311.24
5.2.120.0030.06011.28
5.2.110.0000.05011.21
5.2.100.0030.04311.08
5.2.90.0170.05011.11
5.2.80.0200.04311.31
5.2.70.0100.04311.07
5.2.60.0130.04711.25
5.2.50.0100.04011.23
5.2.40.0030.04011.01
5.2.30.0030.06311.12
5.2.20.0070.04710.99
5.2.10.0070.05711.03
5.2.00.0030.03010.86
5.1.60.0070.02710.10
5.1.50.0070.05010.15
5.1.40.0030.04310.10
5.1.30.0000.03310.46
5.1.20.0070.05310.54
5.1.10.0030.04310.16
5.1.00.0000.04010.20
5.0.50.0030.0378.74
5.0.40.0000.0478.61
5.0.30.0030.0638.33
5.0.20.0000.0338.36
5.0.10.0070.0408.40
5.0.00.0070.0608.45
4.4.90.0030.0378.33
4.4.80.0000.0338.33
4.4.70.0030.0338.33
4.4.60.0000.0408.33
4.4.50.0030.0278.33
4.4.40.0030.0538.33
4.4.30.0070.0338.33
4.4.20.0000.0338.33
4.4.10.0000.0238.33
4.4.00.0070.0508.33
4.3.110.0030.0338.33
4.3.100.0030.0278.33
4.3.90.0030.0338.33
4.3.80.0000.0538.33
4.3.70.0000.0338.33
4.3.60.0070.0278.33
4.3.50.0000.0278.33
4.3.40.0030.0508.33
4.3.30.0000.0208.33
4.3.20.0070.0308.33
4.3.10.0030.0338.33
4.3.00.0070.0178.33

preferences:
39.94 ms | 400 KiB | 5 Q