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); $xml = $xml->translation; //echo $xml->translation->english['ad'].PHP_EOL; echo $xml->translation['id']->italian['name']; echo translate($xml, 'text2', 'italian'); function translate($xml, $id, $lang) { foreach ($xml as $element) { if($element['id'] == $id) { return $element[$lang]; //foreach($element as $key => $val) { // echo $element['id']."{$key}: {$val}".PHP_EOL; //} } } }

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.0080.01118.55
8.3.50.0090.00921.24
8.3.40.0120.00318.79
8.3.30.0030.01019.30
8.3.20.0040.00420.49
8.3.10.0090.00023.83
8.3.00.0090.00019.63
8.2.180.0060.01218.75
8.2.170.0110.00422.96
8.2.160.0070.00720.77
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.48
8.2.110.0070.01019.51
8.2.100.0090.00317.99
8.2.90.0080.00019.48
8.2.80.0030.00617.97
8.2.70.0040.00417.75
8.2.60.0050.00318.28
8.2.50.0040.00418.07
8.2.40.0040.00420.20
8.2.30.0030.00518.29
8.2.20.0030.00618.07
8.2.10.0070.00018.30
8.2.00.0040.00417.92
8.1.280.0080.00825.92
8.1.270.0090.00024.08
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.38
8.1.230.0070.00419.32
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.47
8.1.180.0000.00818.10
8.1.170.0030.00518.92
8.1.160.0070.00022.22
8.1.150.0000.00819.16
8.1.140.0000.00717.71
8.1.130.0070.00018.05
8.1.120.0000.00717.71
8.1.110.0050.00217.70
8.1.100.0080.00017.62
8.1.90.0000.01017.62
8.1.80.0030.00317.59
8.1.70.0070.00017.61
8.1.60.0000.00917.87
8.1.50.0040.00417.79
8.1.40.0080.00017.66
8.1.30.0000.00817.80
8.1.20.0040.00417.96
8.1.10.0040.00417.88
8.1.00.0040.00417.78
8.0.300.0000.00718.77
8.0.290.0080.00017.00
8.0.280.0030.00318.68
8.0.270.0030.00517.37
8.0.260.0030.00317.48
8.0.250.0040.00317.34
8.0.240.0080.00017.14
8.0.230.0050.00517.10
8.0.220.0030.00317.25
8.0.210.0040.00417.07
8.0.200.0000.00717.17
8.0.190.0040.00417.12
8.0.180.0040.00417.22
8.0.170.0040.00417.11
8.0.160.0050.00217.27
8.0.150.0050.00317.02
8.0.140.0060.00317.22
8.0.130.0030.00313.52
8.0.120.0000.00717.20
8.0.110.0030.00517.10
8.0.100.0060.00317.22
8.0.90.0040.00417.07
8.0.80.0100.00717.13
8.0.70.0040.00417.15
8.0.60.0040.00417.18
8.0.50.0040.00416.92
8.0.30.0160.00517.49
8.0.20.0060.01217.49
8.0.10.0000.00717.34
8.0.00.0090.01216.87
7.4.330.0050.00015.31
7.4.320.0030.00316.66
7.4.300.0030.00316.74
7.4.290.0070.00016.76
7.4.280.0070.00016.85
7.4.270.0070.00016.82
7.4.260.0030.00316.91
7.4.250.0040.00416.72
7.4.240.0020.00516.78
7.4.230.0030.00316.93
7.4.220.0090.01116.80
7.4.210.0070.00716.73
7.4.200.0040.00416.85
7.4.160.0160.00316.76
7.4.150.0030.01417.40
7.4.140.0240.01017.86
7.4.130.0130.00816.66
7.4.120.0080.00916.85
7.4.110.0080.00816.88
7.4.100.0110.00716.52
7.4.90.0120.00616.79
7.4.80.0090.00619.39
7.4.70.0100.01316.71
7.4.60.0070.01016.90
7.4.50.0030.00516.46
7.4.40.0070.01016.98
7.4.30.0070.01016.75
7.4.10.0070.01115.28
7.4.00.0050.01215.13
7.3.330.0050.00013.67
7.3.320.0050.00013.48
7.3.310.0070.00016.52
7.3.300.0030.00316.61
7.3.290.0080.00916.65
7.3.280.0090.01016.64
7.3.270.0060.01217.40
7.3.260.0140.00316.59
7.3.250.0080.01016.81
7.3.240.0100.00716.67
7.3.230.0060.01216.68
7.3.210.0030.01716.84
7.3.200.0080.01219.39
7.3.190.0120.00916.64
7.3.180.0040.01216.79
7.3.170.0080.00816.63
7.3.160.0110.00716.69
7.3.130.0110.00614.96
7.3.120.0070.00914.89
7.3.110.0060.01014.88
7.3.100.0050.00714.99
7.3.90.0050.00815.13
7.3.80.0090.00714.94
7.3.70.0020.01114.97
7.3.60.0110.00514.95
7.3.50.0070.00814.96
7.3.40.0000.01214.82
7.3.30.0060.01014.96
7.3.20.0100.00416.71
7.3.10.0060.00816.81
7.3.00.0060.00816.49
7.2.330.0090.00916.71
7.2.320.0110.00716.95
7.2.310.0070.01017.02
7.2.300.0170.00316.71
7.2.290.0040.01816.82
7.2.260.0030.01515.10
7.2.250.0070.01215.05
7.2.240.0020.01215.16
7.2.230.0080.01015.18
7.2.220.0080.00715.19
7.2.210.0020.01515.27
7.2.200.0040.01315.10
7.2.190.0070.00814.96
7.2.180.0040.00915.14
7.2.170.0070.00815.17
7.2.160.0070.00715.11
7.2.150.0020.01516.88
7.2.140.0050.01016.99
7.2.130.0030.01316.96
7.2.120.0060.00917.02
7.2.110.0040.00916.88
7.2.100.0090.00717.00
7.2.90.0050.01017.02
7.2.80.0050.01017.02
7.2.70.0040.00916.98
7.2.60.0030.00817.07
7.2.50.0060.00717.02
7.2.40.0070.00817.04
7.2.30.0050.00817.01
7.2.20.0050.00917.08
7.2.10.0030.00816.96
7.2.00.0060.00916.84
7.1.330.0050.00815.92
7.1.320.0050.00815.91
7.1.310.0060.00815.71
7.1.300.0050.00715.84
7.1.290.0080.00615.68
7.1.280.0010.01015.79
7.1.270.0040.01015.90
7.1.260.0060.00615.78
7.1.250.0000.01415.67
7.1.240.0070.00715.96
7.1.230.0030.00815.83
7.1.220.0030.00815.85
7.1.210.0040.00915.85
7.1.200.0060.01015.94
7.1.190.0060.00515.99
7.1.180.0060.00915.96
7.1.170.0070.00515.79
7.1.160.0060.00715.98
7.1.150.0020.01115.76
7.1.140.0030.01115.94
7.1.130.0050.00715.98
7.1.120.0060.00515.89
7.1.110.0040.00915.71
7.1.100.0020.01015.93
7.1.90.0110.00315.86
7.1.80.0060.00815.84
7.1.70.0050.00916.06
7.1.60.0080.01016.82
7.1.50.0070.00916.08
7.1.40.0080.00615.82
7.1.30.0050.00816.05
7.1.20.0060.00815.88
7.1.10.0050.00715.83
7.1.00.0050.02517.47
7.0.330.0000.00915.35
7.0.320.0040.00615.42
7.0.310.0040.00915.43
7.0.300.0020.01115.54
7.0.290.0050.00715.47
7.0.280.0010.00915.38
7.0.270.0050.00515.50
7.0.260.0040.00915.44
7.0.250.0070.00715.45
7.0.240.0030.00815.39
7.0.230.0020.01215.44
7.0.220.0080.00715.56
7.0.210.0070.00615.53
7.0.200.0030.01015.89
7.0.190.0040.00515.50
7.0.180.0090.00615.40
7.0.170.0010.01215.52
7.0.160.0070.00515.48
7.0.150.0050.00615.53
7.0.140.0060.02317.09
7.0.130.0080.00715.52
7.0.120.0060.00615.58
7.0.110.0060.00715.55
7.0.100.0040.00715.53
7.0.90.0040.00815.43
7.0.80.0040.00715.55
7.0.70.0070.00515.43
7.0.60.0070.02416.66
7.0.50.0060.01616.23
7.0.40.0030.02815.23
7.0.30.0150.01815.34
7.0.20.0110.01815.35
7.0.10.0030.03115.19
7.0.00.0070.01715.20
5.6.400.0080.00514.32
5.6.390.0020.01114.44
5.6.380.0040.00714.42
5.6.370.0050.00714.23
5.6.360.0040.01014.27
5.6.350.0060.00514.40
5.6.340.0040.00914.44
5.6.330.0020.00814.43
5.6.320.0040.00814.26
5.6.310.0050.00914.34
5.6.300.0060.00714.57
5.6.290.0070.00514.44
5.6.280.0060.02416.15
5.6.270.0070.00614.32
5.6.260.0040.00714.31
5.6.250.0080.00614.51
5.6.240.0070.00814.52
5.6.230.0080.00414.46
5.6.220.0060.00914.65
5.6.210.0070.02015.87
5.6.200.0060.02315.52
5.6.190.0070.01516.05
5.6.180.0080.02815.99
5.6.170.0080.01616.05
5.6.160.0020.02716.14
5.6.150.0040.02615.44
5.6.140.0070.02515.38
5.6.130.0040.01915.31
5.6.120.0030.02816.30
5.6.110.0070.02416.18
5.6.100.0060.02516.17
5.6.90.0090.02416.11
5.6.80.0040.02715.90
5.6.70.0240.01515.98
5.6.60.0090.00714.28
5.6.50.0090.00414.46
5.6.40.0090.00614.33
5.6.30.0030.00914.31
5.6.20.0050.00814.40
5.6.10.0080.00314.20
5.6.00.0060.00714.31
5.5.380.0050.00813.27
5.5.370.0030.01113.35
5.5.360.0050.00413.34
5.5.350.0080.02415.13
5.5.340.0070.01514.39
5.5.330.0030.01915.14
5.5.320.0110.01614.86
5.5.310.0100.01915.17
5.5.300.0060.01714.28
5.5.290.0060.02314.46
5.5.280.0040.02515.37
5.5.270.0090.02415.19
5.5.260.0100.02215.08
5.5.250.0080.01615.34
5.5.240.0080.01514.98
5.5.230.0080.00513.47
5.5.220.0100.00513.34
5.5.210.0070.00413.35
5.5.200.0040.00813.27
5.5.190.0080.00313.31
5.5.180.0050.00613.27
5.5.170.0040.01014.26
5.5.160.0080.00113.20
5.5.150.0010.00913.22
5.5.140.0030.00613.29
5.5.130.0060.00913.23
5.5.120.0070.00513.48
5.5.110.0080.00313.44
5.5.100.0050.00513.43
5.5.90.0020.00813.40
5.5.80.0030.00913.34
5.5.70.0100.00213.24
5.5.60.0070.00713.36
5.5.50.0050.00513.32
5.5.40.0040.00813.27
5.5.30.0090.00413.31
5.5.20.0060.00813.28
5.5.10.0070.00613.42
5.5.00.0070.00713.30
5.4.450.0200.01913.60
5.4.440.0230.02013.56
5.4.430.0200.01813.62
5.4.420.0260.01413.59
5.4.410.0190.02113.62
5.4.400.0190.01913.46
5.4.390.0250.02113.54
5.4.380.0270.01813.39
5.4.370.0240.01413.56
5.4.360.0070.01713.51
5.4.350.0160.02413.56
5.4.340.0050.01411.75
5.4.330.0050.00611.69
5.4.320.0050.01711.90
5.4.310.0040.01611.98
5.4.300.0060.01411.89
5.4.290.0030.01611.87
5.4.280.0040.01511.92
5.4.270.0050.01411.91
5.4.260.0020.01511.87
5.4.250.0050.01411.91
5.4.240.0040.01611.86
5.4.230.0010.01711.82
5.4.220.0050.01411.72
5.4.210.0070.01211.82
5.4.200.0030.01511.78
5.4.190.0030.01611.89
5.4.180.0040.01411.82
5.4.170.0050.01411.86
5.4.160.0050.01311.85
5.4.150.0070.01211.81
5.4.140.0040.01511.76
5.4.130.0050.01311.75
5.4.120.0040.01511.73
5.4.110.0070.01111.72
5.4.100.0050.01511.82
5.4.90.0070.01311.78
5.4.80.0030.01511.79
5.4.70.0030.01611.84
5.4.60.0020.01511.76
5.4.50.0020.01411.79
5.4.40.0030.01411.83
5.4.30.0070.01211.83
5.4.20.0050.01411.79
5.4.10.0040.01311.85
5.4.00.0040.01311.64
5.3.290.0050.02211.82
5.3.280.0050.02111.78
5.3.270.0050.02911.69
5.3.260.0080.02311.80
5.3.250.0060.02011.77
5.3.240.0090.02011.69
5.3.230.0040.02111.81
5.3.220.0020.02111.75
5.3.210.0070.02011.80
5.3.200.0060.02011.70
5.3.190.0050.02011.79
5.3.180.0030.02211.80
5.3.170.0040.02411.73
5.3.160.0030.02411.79
5.3.150.0040.02211.73
5.3.140.0050.02211.79
5.3.130.0050.02211.72
5.3.120.0050.02411.62
5.3.110.0080.02611.77
5.3.100.0050.02211.51
5.3.90.0060.02111.61
5.3.80.0050.02111.42
5.3.70.0050.02111.46
5.3.60.0070.02111.38
5.3.50.0040.02211.49
5.3.40.0040.02211.35
5.3.30.0040.02611.43
5.3.20.0050.02211.35
5.3.10.0040.02111.21
5.3.00.0080.01911.15
5.2.170.0030.0199.85
5.2.160.0040.0249.85
5.2.150.0060.0199.85
5.2.140.0080.0149.85
5.2.130.0040.0199.83
5.2.120.0060.0159.83
5.2.110.0060.0169.83
5.2.100.0040.0179.83
5.2.90.0030.0179.83
5.2.80.0060.0179.83
5.2.70.0040.0219.83
5.2.60.0040.0179.81
5.2.50.0020.0229.79
5.2.40.0040.0199.78
5.2.30.0040.0189.77
5.2.20.0050.0179.76
5.2.10.0090.0189.71
5.2.00.0020.0189.64
5.1.60.0060.0129.28
5.1.50.0050.0139.28
5.1.40.0050.0159.27
5.1.30.0020.0169.45
5.1.20.0060.0149.46
5.1.10.0060.0149.32
5.1.00.0040.0169.32
5.0.50.0040.0138.56
5.0.40.0050.0108.49
5.0.30.0000.0218.40
5.0.20.0020.0138.38
5.0.10.0030.0138.37
5.0.00.0030.0188.37
4.4.90.0010.0107.54
4.4.80.0010.0107.53
4.4.70.0030.0107.53
4.4.60.0030.0107.53
4.4.50.0030.0087.54
4.4.40.0030.0157.51
4.4.30.0030.0107.54
4.4.20.0040.0097.57
4.4.10.0050.0087.58
4.4.00.0020.0157.53
4.3.110.0040.0087.49
4.3.100.0020.0107.49
4.3.90.0020.0107.47
4.3.80.0010.0167.45
4.3.70.0020.0117.47
4.3.60.0040.0087.47
4.3.50.0020.0117.47
4.3.40.0000.0167.42
4.3.30.0020.0136.81
4.3.20.0030.0096.79
4.3.10.0030.0116.78
4.3.00.0080.0128.61

preferences:
43.61 ms | 401 KiB | 5 Q