3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'. '<request><body test2="321" test3="987">'. '<rows><my-row test4="564">'. '<types>'. '<custom>this is the example of the text</custom>'. '<Generic arch="simple">this is the example of the text</Generic>'. '<bold/><italic/><underlined/>'. '</types>'. '</my-row><my-row test5="565"/><test hidden="false" ready="true"/></rows>'. '</body></request>'; function f($xml){ $s = array(); foreach ($xml as $key => $value) { $s[$key] = null; if (count($value->attributes())) $s[$key]['attributes'] = $value->attributes(); if (is_string($value)) $s[$key]['content'] = $value; /*print_r(array( 'key' => $key, 'hasChildren' => (bool)$xml->hasChildren(), 'attributes' => (array)$value->attributes(), 'stack' => $s, ));*/ if (get_class($value) == 'SimpleXMLIterator') f($value); } return $s; } print_r(f(new SimpleXMLIterator($s)));

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.0140.00716.75
8.3.50.0120.00822.13
8.3.40.0120.00319.08
8.3.30.0120.00619.28
8.3.20.0060.00320.50
8.3.10.0000.00823.73
8.3.00.0040.00420.86
8.2.180.0120.00316.63
8.2.170.0040.01122.96
8.2.160.0070.01022.32
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00022.52
8.2.110.0060.00321.23
8.2.100.0120.00018.03
8.2.90.0000.00819.45
8.2.80.0050.00317.97
8.2.70.0000.00917.75
8.2.60.0030.00618.18
8.2.50.0060.00318.07
8.2.40.0040.00419.58
8.2.30.0040.00418.35
8.2.20.0030.00517.95
8.2.10.0000.00717.98
8.2.00.0040.00418.07
8.1.280.0210.00025.92
8.1.270.0030.00624.02
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0070.00419.38
8.1.230.0110.00019.25
8.1.220.0000.00818.03
8.1.210.0040.00418.77
8.1.200.0050.00517.59
8.1.190.0050.00317.48
8.1.180.0030.00618.10
8.1.170.0000.00818.78
8.1.160.0040.00422.13
8.1.150.0000.00818.84
8.1.140.0070.00417.66
8.1.130.0040.00418.10
8.1.120.0030.00517.71
8.1.110.0040.00417.53
8.1.100.0040.00417.63
8.1.90.0070.00017.59
8.1.80.0070.00017.63
8.1.70.0030.00317.67
8.1.60.0050.00317.82
8.1.50.0080.00017.79
8.1.40.0000.00817.61
8.1.30.0080.00017.80
8.1.20.0000.00717.95
8.1.10.0050.00317.81
8.1.00.0030.00517.61
8.0.300.0050.00318.78
8.0.290.0040.00416.88
8.0.280.0000.00718.57
8.0.270.0000.00717.49
8.0.260.0030.00317.07
8.0.250.0070.00017.23
8.0.240.0100.00017.08
8.0.230.0030.00317.07
8.0.220.0050.00317.04
8.0.210.0000.00717.11
8.0.200.0040.00417.05
8.0.190.0040.00417.22
8.0.180.0000.00817.06
8.0.170.0000.00817.15
8.0.160.0040.00417.08
8.0.150.0000.01116.95
8.0.140.0030.00316.94
8.0.130.0060.00013.55
8.0.120.0000.00817.01
8.0.110.0020.00517.19
8.0.100.0040.00417.20
8.0.90.0050.00217.09
8.0.80.0070.01017.04
8.0.70.0000.00717.14
8.0.60.0070.00017.18
8.0.50.0040.00417.16
8.0.30.0110.00817.32
8.0.20.0110.00817.40
8.0.10.0040.00417.13
8.0.00.0130.00817.02
7.4.330.0050.00015.25
7.4.320.0000.00616.74
7.4.300.0000.00716.73
7.4.290.0030.00316.83
7.4.280.0000.00716.70
7.4.270.0000.00816.84
7.4.260.0070.00016.71
7.4.250.0050.00316.79
7.4.240.0040.00316.80
7.4.230.0000.00716.90
7.4.220.0060.01216.92
7.4.210.0070.00816.81
7.4.200.0040.00416.80
7.4.190.0000.00916.71
7.4.160.0060.01216.73
7.4.150.0140.00417.40
7.4.140.0120.00817.86
7.4.130.0130.00616.68
7.4.120.0120.00516.87
7.4.110.0070.01016.93
7.4.100.0120.00616.71
7.4.90.0180.00616.73
7.4.80.0070.01116.79
7.4.70.0120.00616.82
7.4.60.0100.00616.69
7.4.50.0080.00016.80
7.4.40.0030.01222.77
7.4.30.0000.01616.79
7.4.10.0100.00715.06
7.4.00.0040.01115.01
7.3.330.0050.00013.39
7.3.320.0000.00513.55
7.3.310.0000.00716.64
7.3.300.0030.00316.58
7.3.290.0040.01116.60
7.3.280.0120.00416.62
7.3.270.0140.00317.40
7.3.260.0060.01216.78
7.3.250.0110.00916.71
7.3.240.0120.00916.85
7.3.230.0090.00616.72
7.3.210.0140.00416.57
7.3.200.0130.00619.39
7.3.190.0140.00616.71
7.3.180.0130.00316.64
7.3.170.0080.00816.84
7.3.160.0070.01016.51
7.3.130.0070.01014.87
7.3.120.0080.00814.94
7.3.110.0120.00514.87
7.3.100.0050.01015.00
7.3.90.0050.00515.04
7.3.80.0070.00714.84
7.3.70.0100.00314.95
7.3.60.0070.00714.96
7.3.50.0020.01214.82
7.3.40.0020.01214.73
7.3.30.0040.01015.08
7.3.20.0100.00616.69
7.3.10.0070.00716.81
7.3.00.0110.00316.61
7.2.330.0090.00916.59
7.2.320.0090.00816.69
7.2.310.0110.00516.63
7.2.300.0110.00816.95
7.2.290.0030.01316.81
7.2.260.0040.01515.42
7.2.250.0070.01115.16
7.2.240.0090.00815.40
7.2.230.0080.00815.25
7.2.220.0060.00915.25
7.2.210.0080.00515.28
7.2.200.0060.00615.40
7.2.190.0080.00815.22
7.2.180.0050.00915.30
7.2.170.0100.00515.30
7.2.160.0030.01015.28
7.2.150.0030.00616.90
7.2.140.0060.00617.25
7.2.130.0070.00717.12
7.2.120.0070.01017.19
7.2.110.0090.00616.75
7.2.100.0040.00816.84
7.2.90.0000.01216.98
7.2.80.0080.00416.99
7.2.70.0090.00616.84
7.2.60.0050.01117.07
7.2.50.0100.00717.21
7.2.40.0000.01217.11
7.2.30.0070.01116.84
7.2.20.0100.00316.94
7.2.10.0070.00716.80
7.2.00.0060.00818.44
7.1.330.0050.01215.96
7.1.320.0100.00415.73
7.1.310.0070.00616.02
7.1.300.0070.00615.75
7.1.290.0050.00716.03
7.1.280.0050.01015.89
7.1.270.0030.01015.89
7.1.260.0070.00516.05
7.1.250.0070.00716.14
7.1.240.0100.00715.61
7.1.230.0050.00815.98
7.1.220.0070.00715.93
7.1.210.0080.00816.02
7.1.200.0020.00815.88
7.1.190.0070.01115.72
7.1.180.0030.01515.96
7.1.170.0090.00015.62
7.1.160.0070.00715.88
7.1.150.0040.01115.61
7.1.140.0070.00715.81
7.1.130.0070.00315.97
7.1.120.0060.01215.73
7.1.110.0070.01016.09
7.1.100.0070.00717.09
7.1.90.0090.00615.85
7.1.80.0060.00915.90
7.1.70.0060.00816.58
7.1.60.0100.01017.58
7.1.50.0100.00716.57
7.1.40.0100.00615.87
7.1.30.0040.00415.96
7.1.20.0070.00715.90
7.1.10.0090.00616.00
7.1.00.0080.03819.21
7.0.330.0110.00715.40
7.0.320.0000.01515.52
7.0.310.0060.00315.53
7.0.300.0050.00515.50
7.0.290.0090.00615.46
7.0.280.0040.01115.52
7.0.270.0110.00015.54
7.0.260.0100.00615.52
7.0.250.0070.01015.38
7.0.240.0100.00315.66
7.0.230.0040.01115.48
7.0.220.0080.00615.58
7.0.210.0070.00715.65
7.0.200.0050.00816.29
7.0.190.0080.00815.43
7.0.180.0060.01015.53
7.0.170.0120.00315.38
7.0.160.0100.00715.52
7.0.150.0080.00415.28
7.0.140.0070.03718.94
7.0.130.0040.01215.39
7.0.120.0030.00615.30
7.0.110.0070.01015.52
7.0.100.0130.04617.78
7.0.90.0090.04417.59
7.0.80.0090.03717.82
7.0.70.0060.04617.87
7.0.60.0040.03317.72
7.0.50.0100.04518.00
7.0.40.0050.04316.81
7.0.30.0030.04216.87
7.0.20.0070.02516.93
7.0.10.0110.04116.83
7.0.00.0090.03716.82
5.6.400.0070.00714.57
5.6.390.0110.00714.50
5.6.380.0040.01114.18
5.6.370.0120.00614.54
5.6.360.0070.01014.20
5.6.350.0090.00314.52
5.6.340.0060.00314.60
5.6.330.0030.01314.41
5.6.320.0000.01314.66
5.6.310.0040.00714.55
5.6.300.0000.00914.50
5.6.290.0090.00614.34
5.6.280.0020.04317.83
5.6.270.0140.00314.72
5.6.260.0060.00914.63
5.6.250.0130.04517.68
5.6.240.0130.04317.65
5.6.230.0090.04317.69
5.6.220.0070.04417.66
5.6.210.0070.03117.79
5.6.200.0100.04017.79
5.6.190.0110.03317.88
5.6.180.0120.04217.82
5.6.170.0080.03317.77
5.6.160.0130.04317.85
5.6.150.0140.03517.83
5.6.140.0090.04417.83
5.6.130.0090.04317.83
5.6.120.0050.03517.84
5.6.110.0020.04617.87
5.6.100.0080.04017.84
5.6.90.0050.04517.76
5.6.80.0060.04017.75
5.6.70.0050.02517.54
5.6.60.0070.03217.46
5.6.50.0100.04217.41
5.6.40.0080.02617.57
5.6.30.0100.03917.40
5.6.20.0070.04317.40
5.6.10.0040.03617.38
5.6.00.0090.02217.31
5.5.380.0090.04317.64
5.5.370.0120.03217.46
5.5.360.0160.03817.45
5.5.350.0090.04117.43
5.5.340.0030.04317.64
5.5.330.0070.04517.55
5.5.320.0120.04017.66
5.5.310.0070.04417.87
5.5.300.0080.04717.77
5.5.290.0070.03117.81
5.5.280.0110.04017.77
5.5.270.0120.04017.84
5.5.260.0080.04317.64
5.5.250.0070.04317.66
5.5.240.0070.04417.45
5.5.230.0110.03317.47
5.5.220.0100.04017.51
5.5.210.0100.04217.47
5.5.200.0070.04117.19
5.5.190.0060.04317.39
5.5.180.0100.04417.40
5.5.170.0040.00414.54
5.5.160.0110.04017.45
5.5.150.0120.03817.39
5.5.140.0080.03817.46
5.5.130.0130.04017.35
5.5.120.0080.04117.54
5.5.110.0070.03417.46
5.5.100.0120.03817.34
5.5.90.0060.04217.31
5.5.80.0100.04017.33
5.5.70.0100.04017.33
5.5.60.0030.02717.34
5.5.50.0050.02417.08
5.5.40.0080.02217.37
5.5.30.0100.03817.26
5.5.20.0020.04817.24
5.5.10.0100.02317.22
5.5.00.0040.02417.35
5.4.450.0050.04115.19
5.4.440.0080.04015.38
5.4.430.0050.04315.25
5.4.420.0070.03315.36
5.4.410.0050.03615.38
5.4.400.0070.04015.03
5.4.390.0060.04315.17
5.4.380.0030.04115.14
5.4.370.0130.02215.16
5.4.360.0030.03915.13
5.4.350.0040.03915.28
5.4.340.0030.04015.04
5.4.330.0060.00011.05
5.4.320.0070.04214.91
5.4.310.0020.04415.28
5.4.300.0080.03315.05
5.4.290.0020.04715.05
5.4.280.0170.02515.15
5.4.270.0140.03015.11
5.4.260.0080.02515.01
5.4.250.0090.03615.18
5.4.240.0090.04015.28
5.4.230.0120.03315.25
5.4.220.0020.03315.18
5.4.210.0020.04614.88
5.4.200.0050.03815.16
5.4.190.0050.03915.23
5.4.180.0050.03615.05
5.4.170.0050.02015.23
5.4.160.0060.01815.04
5.4.150.0070.02215.00
5.4.140.0070.02513.84
5.4.130.0070.02713.83
5.4.120.0060.02813.98
5.4.110.0060.02313.77
5.4.100.0070.02013.71
5.4.90.0080.01813.87
5.4.80.0020.02413.95
5.4.70.0070.02213.87
5.4.60.0080.02113.76
5.4.50.0070.02113.81
5.4.40.0020.02213.82
5.4.30.0070.02013.76
5.4.20.0000.02113.72
5.4.10.0020.02113.62
5.4.00.0030.01913.61
5.3.290.0000.04612.75
5.3.280.0040.04112.65
5.3.270.0020.02312.71
5.3.260.0020.02612.76
5.3.250.0070.01812.77
5.3.240.0030.02812.74
5.3.230.0100.02112.72
5.3.220.0030.02912.65
5.3.210.0060.02312.61
5.3.200.0040.02312.55
5.3.190.0040.02512.71
5.3.180.0060.02112.56
5.3.170.0040.02412.74
5.3.160.0010.02612.68
5.3.150.0040.02512.74
5.3.140.0030.02512.78
5.3.130.0070.02312.65
5.3.120.0030.02312.79
5.3.110.0070.01912.68
5.3.100.0050.02012.41
5.3.90.0030.02512.38
5.3.80.0030.02212.31
5.3.70.0080.01912.29
5.3.60.0040.02212.38
5.3.50.0080.02012.44
5.3.40.0050.02212.36
5.3.30.0030.02212.49
5.3.20.0070.02012.28
5.3.10.0020.02512.05
5.3.00.0020.02612.13
5.2.170.0070.03011.68
5.2.160.0000.03711.68
5.2.150.0030.03011.68
5.2.140.0000.04011.68
5.2.130.0030.03311.68
5.2.120.0000.03711.68
5.2.110.0000.03311.68
5.2.100.0000.03311.68
5.2.90.0030.03311.68
5.2.80.0070.03011.68
5.2.70.0000.04011.68
5.2.60.0000.03311.68
5.2.50.0070.03311.68
5.2.40.0030.03011.68
5.2.30.0000.04011.68
5.2.20.0030.03311.68
5.2.10.0030.02711.68
5.2.00.0030.03311.68
5.1.60.0070.02011.68
5.1.50.0030.02711.68
5.1.40.0030.02711.68
5.1.30.0000.03011.68
5.1.20.0030.03011.68
5.1.10.0030.02711.68
5.1.00.0000.03311.68
5.0.50.0000.02311.68
5.0.40.0030.02011.68
5.0.30.0000.03711.68
5.0.20.0030.02011.68
5.0.10.0000.02011.68
5.0.00.0170.02711.68
4.4.90.0000.02011.68
4.4.80.0070.01311.68
4.4.70.0000.02011.68
4.4.60.0000.01711.68
4.4.50.0030.01311.68
4.4.40.0030.02711.68
4.4.30.0000.01711.68
4.4.20.0030.01711.68
4.4.10.0030.01711.68
4.4.00.0000.02711.68
4.3.110.0000.02011.68
4.3.100.0000.01711.68
4.3.90.0000.01711.68
4.3.80.0000.02711.68
4.3.70.0000.02011.68
4.3.60.0030.01711.68
4.3.50.0030.01711.68
4.3.40.0030.02311.68
4.3.30.0000.01711.68
4.3.20.0000.01711.68
4.3.10.0030.01711.68
4.3.00.0000.01711.68

preferences:
49.61 ms | 401 KiB | 5 Q