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) { $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, ));*/ //var_dump(get_class($value), $stack); if (get_class($value) == 'SimpleXMLIterator') f($value, $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.0130.00318.93
8.3.50.0110.00721.33
8.3.40.0160.00019.09
8.3.30.0110.00419.09
8.3.20.0050.00319.02
8.3.10.0040.00421.34
8.3.00.0040.00423.73
8.2.180.0070.01116.88
8.2.170.0140.00022.96
8.2.160.0100.00320.66
8.2.150.0000.00724.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00421.19
8.2.110.0040.00420.64
8.2.100.0070.00417.97
8.2.90.0090.00019.25
8.2.80.0030.00517.97
8.2.70.0100.00217.50
8.2.60.0000.00818.16
8.2.50.0000.00918.07
8.2.40.0030.00518.11
8.2.30.0000.00821.40
8.2.20.0000.00718.09
8.2.10.0030.00518.14
8.2.00.0030.00518.00
8.1.280.0120.00925.92
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0070.00322.67
8.1.230.0080.00421.10
8.1.220.0040.00418.77
8.1.210.0040.00419.21
8.1.200.0030.00617.61
8.1.190.0000.00817.76
8.1.180.0080.00018.10
8.1.170.0050.00318.76
8.1.160.0000.00719.11
8.1.150.0000.00718.76
8.1.140.0040.00417.58
8.1.130.0030.00518.04
8.1.120.0000.00717.72
8.1.110.0000.00917.57
8.1.100.0030.00617.54
8.1.90.0070.00017.61
8.1.80.0040.00417.72
8.1.70.0030.00317.71
8.1.60.0000.00917.82
8.1.50.0040.00417.75
8.1.40.0080.00017.63
8.1.30.0000.00817.86
8.1.20.0050.00317.78
8.1.10.0000.00817.73
8.1.00.0040.00417.77
8.0.300.0000.00720.10
8.0.290.0000.00917.30
8.0.280.0070.00018.69
8.0.270.0080.00017.48
8.0.260.0070.00016.96
8.0.250.0040.00417.28
8.0.240.0050.00317.12
8.0.230.0000.00717.23
8.0.220.0000.00817.17
8.0.210.0000.00717.17
8.0.200.0000.00717.16
8.0.190.0050.00317.22
8.0.180.0000.00717.23
8.0.170.0000.00717.07
8.0.160.0040.00417.11
8.0.150.0000.00817.18
8.0.140.0070.00017.22
8.0.130.0030.00313.65
8.0.120.0040.00417.05
8.0.110.0000.00717.17
8.0.100.0000.00717.12
8.0.90.0000.00817.09
8.0.80.0100.00317.21
8.0.70.0040.00417.14
8.0.60.0040.00416.94
8.0.50.0030.00517.01
8.0.30.0080.01117.24
8.0.20.0090.00917.40
8.0.10.0000.00717.17
8.0.00.0080.00917.12
7.4.330.0050.00014.96
7.4.320.0060.00316.68
7.4.300.0000.00716.76
7.4.290.0000.00716.81
7.4.280.0000.00716.76
7.4.270.0000.00716.78
7.4.260.0060.00013.50
7.4.250.0030.00516.71
7.4.240.0000.00816.93
7.4.230.0030.00316.53
7.4.220.0150.01316.81
7.4.210.0100.00816.79
7.4.200.0090.00016.59
7.4.190.0080.00016.98
7.4.160.0100.00616.84
7.4.150.0060.01217.40
7.4.140.0110.00817.86
7.4.130.0120.00716.80
7.4.120.0060.01116.97
7.4.110.0100.01316.79
7.4.100.0170.00316.74
7.4.90.0060.01416.86
7.4.80.0060.01319.39
7.4.70.0110.00716.93
7.4.60.0110.01116.79
7.4.50.0030.00516.70
7.4.40.0090.00922.77
7.4.30.0060.01016.68
7.4.10.0060.01315.06
7.4.00.0110.00515.29
7.3.330.0030.00313.45
7.3.320.0000.00513.67
7.3.310.0030.00316.64
7.3.300.0060.00016.53
7.3.290.0030.01016.70
7.3.280.0110.00616.68
7.3.270.0110.00717.40
7.3.260.0130.00718.24
7.3.250.0050.01216.60
7.3.240.0110.00516.94
7.3.230.0070.01016.91
7.3.210.0110.00616.76
7.3.200.0100.01319.39
7.3.190.0130.01016.56
7.3.180.0060.01016.90
7.3.170.0170.00516.71
7.3.160.0090.00616.64
7.3.130.0160.00315.28
7.3.120.0070.01015.00
7.3.110.0170.00014.95
7.3.100.0030.00914.88
7.3.90.0070.01015.14
7.3.80.0070.00715.03
7.3.70.0030.00915.02
7.3.60.0030.01015.09
7.3.50.0040.00714.89
7.3.40.0000.01414.79
7.3.30.0000.01314.89
7.3.20.0040.00416.81
7.3.10.0070.01016.62
7.3.00.0080.00816.85
7.2.330.0110.00717.04
7.2.320.0190.00017.02
7.2.310.0090.00917.04
7.2.300.0130.00616.85
7.2.290.0080.00816.78
7.2.260.0030.00914.94
7.2.250.0190.00015.36
7.2.240.0090.00615.34
7.2.230.0100.00715.46
7.2.220.0000.01715.28
7.2.210.0030.01015.16
7.2.200.0120.00315.23
7.2.190.0000.01515.25
7.2.180.0030.01015.38
7.2.170.0060.00615.27
7.2.160.0030.00915.12
7.2.150.0030.00617.23
7.2.140.0030.01017.14
7.2.130.0030.01416.87
7.2.120.0100.00417.08
7.2.110.0050.01117.12
7.2.100.0060.00716.99
7.2.90.0030.01117.09
7.2.80.0090.00616.96
7.2.70.0120.00517.07
7.2.60.0040.00916.99
7.2.50.0080.00817.08
7.2.40.0080.00816.88
7.2.30.0100.00717.00
7.2.20.0110.00516.94
7.2.10.0040.01116.87
7.2.00.0050.00817.91
7.1.330.0100.00715.69
7.1.320.0040.00816.09
7.1.310.0070.00715.79
7.1.300.0120.00315.91
7.1.290.0040.00716.14
7.1.280.0090.00015.63
7.1.270.0090.00615.91
7.1.260.0080.00715.92
7.1.250.0090.00515.95
7.1.240.0080.00615.93
7.1.230.0090.00615.87
7.1.220.0050.00815.97
7.1.210.0080.00715.82
7.1.200.0100.00415.94
7.1.190.0100.00415.73
7.1.180.0060.00715.75
7.1.170.0030.00815.99
7.1.160.0030.01215.96
7.1.150.0010.01015.80
7.1.140.0030.00916.00
7.1.130.0050.01015.75
7.1.120.0080.00415.94
7.1.110.0070.00515.91
7.1.100.0080.00716.72
7.1.90.0070.00915.94
7.1.80.0100.00515.87
7.1.70.0030.00816.34
7.1.60.0090.00717.02
7.1.50.0080.00816.28
7.1.40.0060.00815.86
7.1.30.0080.00715.96
7.1.20.0060.00615.77
7.1.10.0080.00515.86
7.1.00.0050.01818.04
7.0.330.0050.00715.47
7.0.320.0070.00715.55
7.0.310.0050.00615.58
7.0.300.0060.00815.29
7.0.290.0120.00315.51
7.0.280.0110.00215.64
7.0.270.0100.00415.42
7.0.260.0040.00815.54
7.0.250.0070.00515.63
7.0.240.0060.00915.42
7.0.230.0100.00315.65
7.0.220.0050.00915.48
7.0.210.0030.00815.58
7.0.200.0040.00915.94
7.0.190.0080.00515.52
7.0.180.0050.00715.54
7.0.170.0050.00815.53
7.0.160.0070.00715.58
7.0.150.0080.00715.61
7.0.140.0030.02817.56
7.0.130.0060.01015.51
7.0.120.0090.00515.54
7.0.110.0080.00615.55
7.0.100.0100.00415.49
7.0.90.0080.00615.59
7.0.80.0070.00515.63
7.0.70.0040.03217.52
7.0.60.0090.02917.71
7.0.50.0060.03217.71
7.0.40.0020.03615.79
7.0.30.0060.01815.77
7.0.20.0080.02515.78
7.0.10.0040.02015.76
7.0.00.0080.03215.78
5.6.400.0040.01114.50
5.6.390.0040.00714.96
5.6.380.0050.00914.74
5.6.370.0060.00714.38
5.6.360.0060.00514.50
5.6.350.0070.00614.58
5.6.340.0060.00614.48
5.6.330.0060.00714.48
5.6.320.0060.00714.62
5.6.310.0050.00814.71
5.6.300.0040.00914.67
5.6.290.0050.00714.67
5.6.280.0060.02616.86
5.6.270.0040.00814.48
5.6.260.0050.00914.37
5.6.250.0080.00614.59
5.6.240.0030.00914.54
5.6.230.0050.01014.57
5.6.220.0100.02516.53
5.6.210.0070.02016.48
5.6.200.0060.03316.72
5.6.190.0070.02916.69
5.6.180.0060.02816.72
5.6.170.0060.03316.90
5.6.160.0020.02116.63
5.6.150.0070.03316.69
5.6.140.0070.03216.68
5.6.130.0060.03116.86
5.6.120.0060.03216.73
5.6.110.0060.03316.74
5.6.100.0040.02116.66
5.6.90.0030.03116.68
5.6.80.0070.03116.44
5.6.70.0060.03016.51
5.6.60.0060.03016.61
5.6.50.0060.02316.46
5.6.40.0090.02316.38
5.6.30.0070.02816.53
5.6.20.0080.03016.40
5.6.10.0050.03316.41
5.6.00.0050.03216.57
5.5.380.0040.00712.95
5.5.370.0060.00513.01
5.5.360.0030.03415.41
5.5.350.0100.03115.55
5.5.340.0030.03115.74
5.5.330.0030.03115.75
5.5.320.0020.03115.48
5.5.310.0060.03115.70
5.5.300.0040.02915.72
5.5.290.0020.03215.76
5.5.280.0030.03315.59
5.5.270.0070.03315.77
5.5.260.0070.03215.67
5.5.250.0020.03615.56
5.5.240.0040.03215.41
5.5.230.0040.03115.34
5.5.220.0010.02515.30
5.5.210.0060.03115.52
5.5.200.0050.02815.39
5.5.190.0060.03015.30
5.5.180.0020.03215.39
5.5.170.0060.00612.96
5.5.160.0070.02915.43
5.5.150.0040.03215.34
5.5.140.0060.01815.43
5.5.130.0080.02715.42
5.5.120.0060.02815.48
5.5.110.0070.02915.40
5.5.100.0080.01815.23
5.5.90.0110.02315.46
5.5.80.0050.03115.40
5.5.70.0030.03015.32
5.5.60.0050.03115.25
5.5.50.0070.02715.26
5.5.40.0040.03015.21
5.5.30.0040.02615.20
5.5.20.0030.02715.21
5.5.10.0070.02715.26
5.5.00.0010.02815.27
5.4.450.0080.02814.20
5.4.440.0040.03314.22
5.4.430.0050.03014.27
5.4.420.0030.03414.23
5.4.410.0070.02814.31
5.4.400.0040.02614.16
5.4.390.0070.02914.19
5.4.380.0070.03014.12
5.4.370.0030.02714.00
5.4.360.0100.02114.00
5.4.350.0060.02714.15
5.4.340.0120.02314.13
5.4.330.0060.00711.42
5.4.320.0080.03114.01
5.4.310.0070.02614.17
5.4.300.0050.02114.11
5.4.290.0070.02814.12
5.4.280.0050.03014.09
5.4.270.0050.03213.98
5.4.260.0090.02614.18
5.4.250.0040.03214.08
5.4.240.0030.03314.10
5.4.230.0020.03314.06
5.4.220.0040.03114.00
5.4.210.0060.01913.90
5.4.200.0080.02714.11
5.4.190.0080.02714.03
5.4.180.0070.02014.16
5.4.170.0010.03514.06
5.4.160.0060.03114.07
5.4.150.0030.02314.04
5.4.140.0070.02813.21
5.4.130.0060.02613.29
5.4.120.0020.03213.16
5.4.110.0040.03113.13
5.4.100.0040.02613.22
5.4.90.0060.01813.21
5.4.80.0040.02413.31
5.4.70.0050.02813.25
5.4.60.0060.02613.25
5.4.50.0070.02113.26
5.4.40.0050.03113.35
5.4.30.0070.01813.26
5.4.20.0050.02713.32
5.4.10.0020.02613.25
5.4.00.0040.02912.96
5.3.290.0040.03012.49
5.3.280.0060.02212.43
5.3.270.0090.02112.41
5.3.260.0050.02312.46
5.3.250.0080.02912.47
5.3.240.0060.02912.44
5.3.230.0050.02712.48
5.3.220.0110.02212.50
5.3.210.0040.03412.39
5.3.200.0070.02312.40
5.3.190.0040.02712.36
5.3.180.0070.02512.47
5.3.170.0040.02912.41
5.3.160.0060.02912.39
5.3.150.0060.02812.49
5.3.140.0020.02212.42
5.3.130.0090.02212.46
5.3.120.0040.03112.41
5.3.110.0060.02812.45
5.3.100.0050.02612.27
5.3.90.0020.03212.29
5.3.80.0060.02712.22
5.3.70.0060.02712.22
5.3.60.0070.02512.15
5.3.50.0060.02612.23
5.3.40.0030.02612.25
5.3.30.0030.02912.27
5.3.20.0070.02712.06
5.3.10.0040.02412.08
5.3.00.0110.02312.04
5.2.170.0060.03011.15
5.2.160.0050.03211.15
5.2.150.0050.03111.15
5.2.140.0030.03611.15
5.2.130.0030.02411.15
5.2.120.0080.02511.15
5.2.110.0020.02511.15
5.2.100.0050.03611.15
5.2.90.0020.03511.15
5.2.80.0060.02811.15
5.2.70.0050.02411.15
5.2.60.0060.03311.15
5.2.50.0060.03611.15
5.2.40.0030.03511.15
5.2.30.0040.03311.15
5.2.20.0050.03311.15
5.2.10.0070.03011.15
5.2.00.0070.03211.15
5.1.60.0040.02511.15
5.1.50.0060.02711.15
5.1.40.0020.03011.15
5.1.30.0040.02811.15
5.1.20.0050.03111.15
5.1.10.0060.02911.15
5.1.00.0040.03011.15
5.0.50.0030.02411.15
5.0.40.0040.02211.15
5.0.30.0080.02711.15
5.0.20.0050.02411.15
5.0.10.0000.02511.15
5.0.00.0030.03211.15
4.4.90.0030.01611.15
4.4.80.0000.02211.15
4.4.70.0030.01811.15
4.4.60.0000.02311.15
4.4.50.0050.00911.15
4.4.40.0030.03011.15
4.4.30.0000.02611.15
4.4.20.0040.01711.15
4.4.10.0020.02111.15
4.4.00.0020.02911.15
4.3.110.0000.02211.15
4.3.100.0020.01511.15
4.3.90.0020.01911.15
4.3.80.0020.02811.15
4.3.70.0020.02011.15
4.3.60.0030.01711.15
4.3.50.0000.01511.15
4.3.40.0000.03011.15
4.3.30.0020.02111.15
4.3.20.0030.02011.15
4.3.10.0020.01511.15
4.3.00.0030.01711.15

preferences:
40.18 ms | 401 KiB | 5 Q