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) { print_r(array( 'call', $stack )); $stack = count($stack) ? $stack : array(); foreach ($xml as $key => $value) { $stack[$key] = null; if (count($value->attributes())) $stack[$key]['attributes'] = (array)$value->attributes(); if (is_string($value)) $stack[$key]['content'] = (string)$value; /*print_r(array( 'key' => $key, 'hasChildren' => (bool)$xml->hasChildren(), 'attributes' => (array)$value->attributes(), 'stack' => $s, ));*/ print_r(array( 'call', $value, )); if (get_class($value) == 'SimpleXMLIterator' && $xml->hasChildren()) f($xml->getChildren(), $stack); } return $stack; } 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.0090.00918.55
8.3.50.0110.00821.33
8.3.40.0110.00719.00
8.3.30.0000.01419.00
8.3.20.0030.00518.98
8.3.10.0040.00420.77
8.3.00.0030.00523.87
8.2.180.0110.01116.88
8.2.170.0110.00422.96
8.2.160.0130.00321.27
8.2.150.0080.00324.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0100.00317.75
8.2.110.0000.00922.51
8.2.100.0040.00818.09
8.2.90.0080.00019.33
8.2.80.0030.00618.41
8.2.70.0040.00417.88
8.2.60.0000.00818.05
8.2.50.0000.00818.07
8.2.40.0080.00018.41
8.2.30.0090.00020.00
8.2.20.0000.00817.96
8.2.10.0000.00718.00
8.2.00.0050.00318.06
8.1.280.0120.00625.92
8.1.270.0070.00023.99
8.1.260.0140.00026.35
8.1.250.0080.00028.09
8.1.240.0080.00422.72
8.1.230.0070.00421.15
8.1.220.0060.00318.77
8.1.210.0000.00919.15
8.1.200.0050.00517.50
8.1.190.0070.00017.66
8.1.180.0040.00418.10
8.1.170.0000.00818.86
8.1.160.0050.00219.13
8.1.150.0050.00218.76
8.1.140.0070.00017.71
8.1.130.0000.00718.07
8.1.120.0040.00417.71
8.1.110.0040.00417.78
8.1.100.0000.00717.59
8.1.90.0000.00717.62
8.1.80.0040.00417.77
8.1.70.0000.00717.54
8.1.60.0030.00517.70
8.1.50.0080.00017.77
8.1.40.0040.00417.72
8.1.30.0040.00417.95
8.1.20.0000.00817.90
8.1.10.0050.00317.71
8.1.00.0060.00317.63
8.0.300.0000.00720.28
8.0.290.0050.00317.13
8.0.280.0000.00718.69
8.0.270.0000.00717.39
8.0.260.0030.00317.21
8.0.250.0040.00417.14
8.0.240.0030.00617.18
8.0.230.0030.00317.07
8.0.220.0000.00717.27
8.0.210.0050.00317.28
8.0.200.0030.00317.32
8.0.190.0070.00017.14
8.0.180.0000.00717.26
8.0.170.0000.00717.30
8.0.160.0040.00417.12
8.0.150.0060.00317.02
8.0.140.0050.00217.04
8.0.130.0040.00413.67
8.0.120.0000.00717.16
8.0.110.0000.00717.21
8.0.100.0000.01017.26
8.0.90.0000.00717.02
8.0.80.0080.00717.21
8.0.70.0000.00817.29
8.0.60.0040.00417.06
8.0.50.0000.00817.14
8.0.30.0130.00817.25
8.0.20.0100.00917.40
8.0.10.0000.00717.13
8.0.00.0130.00716.97
7.4.330.0000.00514.87
7.4.320.0000.00616.78
7.4.300.0070.00016.80
7.4.290.0070.00016.85
7.4.280.0060.00316.82
7.4.270.0040.00416.86
7.4.260.0030.00313.50
7.4.250.0040.00416.69
7.4.240.0020.00516.63
7.4.230.0030.00316.84
7.4.220.0060.01916.61
7.4.210.0070.00916.78
7.4.200.0000.00816.84
7.4.190.0040.00416.92
7.4.160.0120.01216.75
7.4.150.0150.00617.40
7.4.140.0080.01017.86
7.4.130.0100.00916.78
7.4.120.0080.01116.93
7.4.110.0140.00316.84
7.4.100.0060.01216.77
7.4.90.0060.01316.63
7.4.80.0100.01019.37
7.4.70.0100.01416.82
7.4.60.0160.00316.52
7.4.50.0030.00316.36
7.4.40.0000.01522.27
7.4.30.0090.01216.94
7.4.00.0030.01115.16
7.3.330.0070.00013.46
7.3.320.0060.00013.43
7.3.310.0050.00216.72
7.3.300.0000.00716.55
7.3.290.0040.01116.63
7.3.280.0130.00416.64
7.3.270.0100.00717.40
7.3.260.0100.01318.24
7.3.250.0070.01416.75
7.3.240.0180.00016.85
7.3.230.0060.01216.61
7.3.210.0040.01516.65
7.3.200.0120.00619.39
7.3.190.0100.01316.73
7.3.180.0030.01616.60
7.3.170.0090.00916.85
7.3.160.0000.01516.73
7.3.120.0030.01015.14
7.3.110.0130.00314.98
7.3.100.0070.00715.27
7.3.90.0030.01315.05
7.3.80.0000.01514.87
7.3.70.0030.01014.97
7.3.60.0090.00015.04
7.3.50.0150.00014.87
7.3.40.0030.00614.98
7.3.30.0070.00715.00
7.3.20.0000.00916.79
7.3.10.0070.00816.42
7.3.00.0070.00816.57
7.2.330.0060.01216.94
7.2.320.0080.00816.75
7.2.310.0120.00617.11
7.2.300.0040.01417.04
7.2.290.0120.00617.07
7.2.250.0040.01514.98
7.2.240.0070.01115.30
7.2.230.0040.01215.38
7.2.220.0060.00915.49
7.2.210.0070.00715.42
7.2.200.0060.01215.11
7.2.190.0060.01015.15
7.2.180.0030.01315.10
7.2.170.0110.00415.11
7.2.130.0100.00716.98
7.2.120.0170.00616.60
7.2.110.0110.00716.53
7.2.100.0040.01116.65
7.2.90.0050.00516.48
7.2.80.0000.01916.78
7.2.70.0160.00316.87
7.2.60.0110.00916.88
7.2.50.0090.00616.65
7.2.40.0130.00317.03
7.2.30.0090.01616.95
7.2.20.0180.00917.02
7.2.10.0140.00816.63
7.2.00.0200.00716.53
7.1.330.0070.01015.93
7.1.320.0000.01315.84
7.1.310.0040.00415.77
7.1.300.0030.01315.91
7.1.290.0040.01115.87
7.1.280.0040.01115.57
7.1.270.0120.00315.93
7.1.260.0030.00915.99
7.1.250.0040.01015.72
7.1.200.0070.00715.69
7.1.100.0040.00818.24
7.1.70.0040.00417.22
7.1.60.0000.02419.40
7.1.50.0260.01034.63
7.1.00.0000.06022.40
7.0.200.0510.00714.69
7.0.140.0170.07022.05
7.0.60.0230.06720.13
7.0.50.0130.04018.07
7.0.40.0170.08020.33
7.0.30.0430.06320.32
7.0.20.0270.08320.20
7.0.10.0100.06720.41
7.0.00.0100.09020.37
5.6.210.0000.04720.93
5.6.200.0130.05718.32
5.6.190.0100.05720.57
5.6.180.0270.04720.70
5.6.170.0270.04720.58
5.6.160.0130.06320.52
5.6.150.0100.06318.36
5.6.140.0070.04018.35
5.6.130.0100.07718.30
5.6.120.0130.05021.20
5.6.110.0070.07321.16
5.6.100.0100.08721.20
5.6.90.0270.07021.20
5.6.80.0130.07720.59
5.5.350.3570.03720.45
5.5.340.0200.07018.05
5.5.330.0130.08720.42
5.5.320.0070.08320.39
5.5.310.0430.05020.38
5.5.300.0170.06318.02
5.5.290.0030.08718.05
5.5.280.0100.07720.80
5.5.270.0070.09020.86
5.5.260.0200.07320.94
5.5.250.0200.07720.56
5.5.240.0170.08320.24
5.4.450.3430.03319.41
5.4.440.3600.04019.38
5.4.430.3430.04319.48
5.4.420.3830.04719.62
5.4.410.3500.04319.41
5.4.400.3770.03319.17
5.4.390.4200.04319.29
5.4.380.4070.03719.32
5.4.370.3600.03319.20
5.4.360.4170.04019.32
5.4.350.4330.03719.06
5.4.340.3670.03719.32
5.4.320.4370.04019.42
5.4.310.5030.03019.36
5.4.300.4270.03719.12
5.4.290.4070.03319.05
5.4.280.3630.04019.31
5.4.270.4630.04019.13
5.4.260.3700.03719.15
5.4.250.0170.06019.39
5.4.240.2300.03319.14
5.4.230.4570.04019.29
5.4.220.4130.03719.20
5.4.210.4130.03019.12
5.4.200.3730.03319.16
5.4.190.4030.03019.35
5.4.180.4430.03019.12
5.4.170.4500.02719.14
5.4.160.3600.04019.14
5.4.150.3830.03719.04
5.4.140.3470.04016.58
5.4.130.3830.03716.46
5.4.120.2830.03316.54
5.4.110.3430.03716.53
5.4.100.3530.03316.54
5.4.90.3870.03016.67
5.4.80.3100.02716.56
5.4.70.2200.03316.38
5.4.60.2630.03716.64
5.4.50.2530.03716.50
5.4.40.2470.03716.51
5.4.30.3400.03016.54
5.4.20.3330.03316.49
5.4.10.4130.04316.55
5.4.00.3370.03315.95
5.3.290.4300.03014.86
5.3.280.4930.02714.82
5.3.270.4570.04014.68
5.3.260.3730.03314.87
5.3.250.4470.04014.70
5.3.240.4230.04314.67
5.3.230.3270.03014.66
5.3.220.3330.03714.67
5.3.210.3670.03014.74
5.3.200.3700.03314.80
5.3.190.2900.03714.73
5.3.180.3430.04014.64
5.3.170.3430.02714.67
5.3.160.3000.03314.79
5.3.150.2700.04314.63
5.3.140.3170.03714.82
5.3.130.3270.04014.61
5.3.120.3470.03714.62
5.3.110.4970.03014.60
5.3.100.3300.03714.10
5.3.90.4030.04014.23
5.3.80.4230.03714.03
5.3.70.3800.04714.01
5.3.60.4200.03714.25
5.3.50.4170.04013.95
5.3.40.4300.04314.05
5.3.30.3830.03013.93
5.3.20.3300.04013.74
5.3.10.3430.03013.73
5.3.00.3330.03713.71
5.2.170.3000.03011.33
5.2.160.2870.03011.16
5.2.150.3100.02711.24
5.2.140.2770.03011.33
5.2.130.2970.02711.22
5.2.120.3030.02711.18
5.2.110.3070.03311.20
5.2.100.2900.03311.23
5.2.90.3170.03011.34
5.2.80.2770.03311.29
5.2.70.2930.02711.17
5.2.60.3100.03311.13
5.2.50.3070.03011.03
5.2.40.2230.02711.07
5.2.30.2430.03011.20
5.2.20.2830.02711.05
5.2.10.2870.03010.94
5.2.00.3200.03010.80
5.1.60.2700.03310.05
5.1.50.2370.02010.34
5.1.40.2370.01710.05
5.1.30.2800.03010.61
5.1.20.2070.03010.65
5.1.10.2300.02710.16
5.1.00.2530.03310.17
5.0.50.1200.0178.85
5.0.40.1270.0238.65
5.0.30.1300.0338.65
5.0.20.1400.0208.65
5.0.10.1300.0238.65
5.0.00.1500.0378.65
4.4.90.1300.0208.65
4.4.80.1230.0178.65
4.4.70.1270.0208.65
4.4.60.1430.0208.65
4.4.50.1700.0178.65
4.4.40.1300.0338.65
4.4.30.1530.0108.65
4.4.20.1270.0178.65
4.4.10.1270.0208.65
4.4.00.1270.0338.65
4.3.110.1330.0178.65
4.3.100.1270.0178.65
4.3.90.1270.0138.65
4.3.80.1330.0278.65
4.3.70.1270.0108.65
4.3.60.1170.0178.65
4.3.50.1170.0208.65
4.3.40.1300.0278.65
4.3.30.0570.0178.65
4.3.20.0730.0178.65
4.3.10.0800.0138.65
4.3.00.0700.0178.65

preferences:
40.51 ms | 401 KiB | 5 Q