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, $stack = null) { $s = count($stack) ? $stack : array(); foreach ($xml as $key => $value) { $s[$key] = null; if (count($value->attributes())) $s[$key]['attributes'] = (array)$value->attributes()['@attributes']; if (is_string($value)) $s[$key]['content'] = (string)$value; /*print_r(array( 'key' => $key, 'hasChildren' => (bool)$xml->hasChildren(), 'attributes' => (array)$value->attributes(), 'stack' => $s, ));*/ var_dump(get_class($value)); if (get_class($value) == 'SimpleXMLIterator') f($value, $s); } 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.00418.58
8.3.50.0080.00822.18
8.3.40.0100.00719.09
8.3.30.0030.01019.42
8.3.20.0000.00820.54
8.3.10.0050.00323.82
8.3.00.0040.00422.70
8.2.180.0080.00818.91
8.2.170.0070.01122.96
8.2.160.0030.01020.60
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0070.00022.46
8.2.110.0080.00022.39
8.2.100.0060.00617.91
8.2.90.0000.00819.52
8.2.80.0050.00318.18
8.2.70.0080.00017.75
8.2.60.0040.00418.16
8.2.50.0030.00518.07
8.2.40.0000.00818.18
8.2.30.0050.00318.31
8.2.20.0040.00417.85
8.2.10.0050.00319.74
8.2.00.0060.00318.06
8.1.280.0090.00625.92
8.1.270.0080.00024.08
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.88
8.1.230.0120.00019.30
8.1.220.0040.00418.04
8.1.210.0000.00818.77
8.1.200.0060.00617.48
8.1.190.0050.00317.65
8.1.180.0030.00618.10
8.1.170.0030.00518.84
8.1.160.0040.00422.20
8.1.150.0040.00418.87
8.1.140.0070.00017.59
8.1.130.0050.00318.07
8.1.120.0050.00217.64
8.1.110.0040.00417.72
8.1.100.0040.00417.75
8.1.90.0040.00417.67
8.1.80.0040.00417.78
8.1.70.0040.00417.61
8.1.60.0040.00417.73
8.1.50.0000.00817.84
8.1.40.0000.00817.69
8.1.30.0040.00417.96
8.1.20.0050.00317.96
8.1.10.0040.00417.81
8.1.00.0080.00017.80
8.0.300.0080.00018.77
8.0.290.0080.00017.43
8.0.280.0020.00518.71
8.0.270.0030.00617.34
8.0.260.0000.00717.05
8.0.250.0030.00317.11
8.0.240.0000.00917.25
8.0.230.0080.00017.21
8.0.220.0030.00317.02
8.0.210.0000.00717.20
8.0.200.0070.00017.17
8.0.190.0070.00017.20
8.0.180.0040.00417.23
8.0.170.0030.00617.12
8.0.160.0000.00717.19
8.0.150.0060.00317.15
8.0.140.0030.00517.09
8.0.130.0000.00613.58
8.0.120.0000.00817.05
8.0.110.0000.00717.10
8.0.100.0000.00817.22
8.0.90.0070.00017.03
8.0.80.0070.01117.26
8.0.70.0000.00717.21
8.0.60.0040.00417.23
8.0.50.0000.00717.04
8.0.30.0100.00817.14
8.0.20.0110.00817.48
8.0.10.0070.00017.22
8.0.00.0090.01116.95
7.4.330.0000.00515.25
7.4.320.0040.00416.64
7.4.300.0030.00316.77
7.4.290.0070.00016.80
7.4.280.0080.00016.76
7.4.270.0040.00416.71
7.4.260.0070.00016.87
7.4.250.0040.00416.72
7.4.240.0030.00316.85
7.4.230.0030.00316.86
7.4.220.0090.01616.87
7.4.210.0080.00716.80
7.4.200.0000.00816.79
7.4.190.0040.00416.64
7.4.160.0140.00316.70
7.4.150.0180.00617.40
7.4.140.0060.01817.86
7.4.130.0090.00816.84
7.4.120.0100.00816.85
7.4.110.0140.00316.74
7.4.100.0140.00716.75
7.4.90.0090.00916.86
7.4.80.0080.00819.39
7.4.70.0090.00916.79
7.4.60.0130.00916.89
7.4.50.0000.00516.80
7.4.40.0040.01122.77
7.4.30.0140.00316.71
7.4.10.0070.01015.17
7.4.00.0050.01215.22
7.3.330.0000.00613.47
7.3.320.0000.00513.71
7.3.310.0070.00016.71
7.3.300.0030.00316.68
7.3.290.0070.01416.68
7.3.280.0120.00816.69
7.3.270.0060.01217.40
7.3.260.0130.00416.70
7.3.250.0110.00816.81
7.3.240.0140.00316.85
7.3.230.0080.00816.74
7.3.210.0060.01316.76
7.3.200.0100.00719.39
7.3.190.0130.01016.74
7.3.180.0160.00016.85
7.3.170.0060.01216.81
7.3.160.0090.00616.82
7.3.130.0040.01415.12
7.3.120.0060.01215.06
7.3.110.0060.01115.01
7.3.100.0070.00615.04
7.3.90.0070.00814.99
7.3.80.0070.00815.00
7.3.70.0050.00814.94
7.3.60.0070.00715.00
7.3.50.0070.00714.99
7.3.40.0040.00614.87
7.3.30.0040.00614.83
7.3.20.0040.00816.73
7.3.10.0050.00816.73
7.3.00.0070.00716.83
7.2.330.0030.01617.04
7.2.320.0120.00616.66
7.2.310.0100.00716.90
7.2.300.0060.01216.94
7.2.290.0090.00816.76
7.2.260.0040.01715.17
7.2.250.0080.00915.34
7.2.240.0100.00615.26
7.2.230.0060.00915.18
7.2.220.0080.00615.24
7.2.210.0050.01015.26
7.2.200.0050.00715.41
7.2.190.0060.00815.18
7.2.180.0050.00915.12
7.2.170.0080.00815.16
7.2.160.0060.00715.17
7.2.150.0090.00617.07
7.2.140.0050.00817.06
7.2.130.0070.00717.13
7.2.120.0070.00517.04
7.2.110.0060.00717.09
7.2.100.0060.00717.02
7.2.90.0070.00717.01
7.2.80.0060.00816.94
7.2.70.0060.00817.07
7.2.60.0060.00717.00
7.2.50.0070.00717.03
7.2.40.0080.00717.01
7.2.30.0050.00717.02
7.2.20.0070.00817.02
7.2.10.0060.00917.08
7.2.00.0040.00917.51
7.1.330.0080.00715.90
7.1.320.0050.00715.89
7.1.310.0050.00715.85
7.1.300.0060.00815.77
7.1.290.0010.00815.88
7.1.280.0040.00815.70
7.1.270.0060.00715.75
7.1.260.0040.00915.99
7.1.250.0050.00915.88
7.1.240.0040.00715.80
7.1.230.0060.00616.00
7.1.220.0030.00915.82
7.1.210.0030.01215.95
7.1.200.0080.00616.06
7.1.190.0050.00615.97
7.1.180.0060.00616.01
7.1.170.0050.01015.93
7.1.160.0030.00715.84
7.1.150.0030.00915.90
7.1.140.0050.00615.89
7.1.130.0050.01115.84
7.1.120.0060.00815.88
7.1.110.0040.00615.85
7.1.100.0070.00716.84
7.1.90.0070.00715.96
7.1.80.0080.00715.86
7.1.70.0050.00616.35
7.1.60.0080.01017.04
7.1.50.0040.01216.31
7.1.40.0070.00415.84
7.1.30.0080.00515.89
7.1.20.0030.00815.80
7.1.10.0070.00715.74
7.1.00.0070.02618.20
7.0.330.0030.00915.63
7.0.320.0020.01315.24
7.0.310.0050.00915.68
7.0.300.0030.01015.42
7.0.290.0070.00315.49
7.0.280.0080.00315.36
7.0.270.0030.01115.57
7.0.260.0040.00715.38
7.0.250.0060.00815.52
7.0.240.0030.01015.54
7.0.230.0090.00215.59
7.0.220.0020.01415.57
7.0.210.0050.00415.43
7.0.200.0080.00615.89
7.0.190.0090.00415.53
7.0.180.0030.00715.59
7.0.170.0050.00415.66
7.0.160.0030.00715.50
7.0.150.0000.01115.61
7.0.140.0040.03017.75
7.0.130.0030.01015.57
7.0.120.0050.00815.60
7.0.110.0000.01415.43
7.0.100.0150.03317.14
7.0.90.0070.03117.07
7.0.80.0120.03216.87
7.0.70.0080.02917.00
7.0.60.0070.02916.98
7.0.50.0070.03417.20
7.0.40.0040.03415.89
7.0.30.0020.03315.80
7.0.20.0100.03515.82
7.0.10.0060.03215.78
7.0.00.0070.02415.74
5.6.400.0110.00214.72
5.6.390.0060.00814.53
5.6.380.0080.00814.71
5.6.370.0070.00414.41
5.6.360.0060.00514.57
5.6.350.0050.00914.67
5.6.340.0060.01114.67
5.6.330.0080.00414.39
5.6.320.0030.00714.54
5.6.310.0070.00514.48
5.6.300.0050.00714.85
5.6.290.0050.00914.67
5.6.280.0050.02716.78
5.6.270.0050.01014.50
5.6.260.0020.01514.59
5.6.250.0040.03016.73
5.6.240.0110.02816.65
5.6.230.0040.03316.58
5.6.220.0060.03316.55
5.6.210.0110.01716.62
5.6.200.0080.03516.83
5.6.190.0110.02116.77
5.6.180.0070.03016.78
5.6.170.0070.03216.75
5.6.160.0050.02916.76
5.6.150.0070.02616.76
5.6.140.0080.02416.68
5.6.130.0130.02716.83
5.6.120.0050.03516.62
5.6.110.0080.03416.78
5.6.100.0060.03216.78
5.6.90.0080.03216.72
5.6.80.0030.03716.52
5.6.70.0060.03216.44
5.6.60.0080.03016.34
5.6.50.0040.02316.38
5.6.40.0050.03216.53
5.6.30.0040.02316.63
5.6.20.0090.03016.37
5.6.10.0050.02516.45
5.6.00.0070.02916.41
5.5.380.0050.02616.55
5.5.370.0100.03216.53
5.5.360.0120.02716.55
5.5.350.0050.03116.63
5.5.340.0060.03416.70
5.5.330.0080.03016.77
5.5.320.0070.03516.70
5.5.310.0040.03316.71
5.5.300.0070.03216.85
5.5.290.0060.03116.61
5.5.280.0050.03616.80
5.5.270.0060.02316.66
5.5.260.0090.03116.69
5.5.250.0080.02016.51
5.5.240.0040.03116.48
5.5.230.0060.03616.48
5.5.220.0030.02416.44
5.5.210.0070.02816.38
5.5.200.0060.02716.45
5.5.190.0050.03216.30
5.5.180.0080.02716.43
5.5.170.0050.01114.57
5.5.160.0060.03216.35
5.5.150.0040.02416.44
5.5.140.0060.02316.40
5.5.130.0080.02516.31
5.5.120.0050.02616.39
5.5.110.0060.02816.45
5.5.100.0040.03316.43
5.5.90.0070.02916.43
5.5.80.0070.03116.39
5.5.70.0050.02116.29
5.5.60.0090.02816.32
5.5.50.0100.03016.42
5.5.40.0090.02916.32
5.5.30.0050.03116.41
5.5.20.0050.02816.47
5.5.10.0020.02516.47
5.5.00.0020.02416.40
5.4.450.0060.03314.20
5.4.440.0070.02914.21
5.4.430.0090.02614.18
5.4.420.0060.03114.09
5.4.410.0050.03014.21
5.4.400.0030.02513.98
5.4.390.0090.02714.04
5.4.380.0030.03014.02
5.4.370.0110.02414.00
5.4.360.0020.02914.05
5.4.350.0070.02813.99
5.4.340.0050.03114.02
5.4.330.0020.00911.50
5.4.320.0060.02714.04
5.4.310.0020.03114.14
5.4.300.0090.01313.99
5.4.290.0070.02813.95
5.4.280.0040.02014.05
5.4.270.0070.01613.96
5.4.260.0090.02413.99
5.4.250.0040.02514.01
5.4.240.0040.02814.04
5.4.230.0050.02514.03
5.4.220.0070.02413.98
5.4.210.0030.03213.95
5.4.200.0060.02914.08
5.4.190.0030.02214.12
5.4.180.0080.02214.04
5.4.170.0070.02713.90
5.4.160.0090.02613.97
5.4.150.0050.02814.02
5.4.140.0090.02313.13
5.4.130.0070.02613.09
5.4.120.0060.02613.10
5.4.110.0030.03013.25
5.4.100.0080.02813.25
5.4.90.0020.02113.18
5.4.80.0050.02513.25
5.4.70.0060.02113.25
5.4.60.0050.02413.17
5.4.50.0060.01813.18
5.4.40.0060.02813.18
5.4.30.0060.01913.16
5.4.20.0040.02513.26
5.4.10.0050.02713.14
5.4.00.0100.02312.93
5.3.290.0090.01612.29
5.3.280.0090.02212.21
5.3.270.0070.02612.21
5.3.260.0070.02612.21
5.3.250.0040.02012.23
5.3.240.0080.02412.25
5.3.230.0080.01812.25
5.3.220.0050.02912.17
5.3.210.0080.02512.23
5.3.200.0090.03212.21
5.3.190.0090.02612.23
5.3.180.0070.03012.21
5.3.170.0100.02712.20
5.3.160.0040.03012.19
5.3.150.0120.01812.23
5.3.140.0060.02712.23
5.3.130.0040.02212.21
5.3.120.0080.02812.17
5.3.110.0070.03012.22
5.3.100.0080.02712.06
5.3.90.0060.02212.04
5.3.80.0030.01811.98
5.3.70.0090.02512.00
5.3.60.0080.01411.99
5.3.50.0050.02111.97
5.3.40.0060.02912.01
5.3.30.0080.02612.02
5.3.20.0080.02311.87
5.3.10.0070.02711.90
5.3.00.0060.02011.88
5.2.170.0030.06011.21
5.2.160.0000.06711.26
5.2.150.0100.05011.13
5.2.140.0070.03311.27
5.2.130.0070.05311.02
5.2.120.0030.03311.17
5.2.110.0070.05711.12
5.2.100.0030.03711.22
5.2.90.0000.03711.24
5.2.80.0070.02711.22
5.2.70.0000.05311.23
5.2.60.0030.06710.99
5.2.50.0100.05011.05
5.2.40.0030.05710.86
5.2.30.0030.06310.99
5.2.20.0030.05710.98
5.2.10.0070.05310.95
5.2.00.0070.06010.84
5.1.60.0070.05010.11
5.1.50.0070.05310.07
5.1.40.0030.0609.82
5.1.30.0100.05310.41
5.1.20.0030.04310.49
5.1.10.0070.0379.91
5.1.00.0000.03310.08
5.0.50.0070.0479.47
5.0.40.0100.0239.47
5.0.30.0030.0609.47
5.0.20.0070.0309.47
5.0.10.0000.0209.47
5.0.00.0030.0309.47
4.4.90.0000.0379.47
4.4.80.0030.0379.47
4.4.70.0070.0279.47
4.4.60.0000.0239.47
4.4.50.0030.0309.47
4.4.40.0000.0409.47
4.4.30.0000.0409.47
4.4.20.0000.0279.47
4.4.10.0030.0179.47
4.4.00.0030.0309.47
4.3.110.0000.0209.47
4.3.100.0030.0209.47
4.3.90.0030.0179.47
4.3.80.0070.0439.47
4.3.70.0000.0279.47
4.3.60.0000.0239.47
4.3.50.0070.0309.47
4.3.40.0070.0409.47
4.3.30.0000.0379.47
4.3.20.0000.0379.47
4.3.10.0070.0239.47
4.3.00.0000.0179.47

preferences:
41.92 ms | 401 KiB | 5 Q