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(); 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.0100.01017.13
8.3.50.0140.00516.84
8.3.40.0120.00319.04
8.3.30.0070.00718.92
8.3.20.0050.00319.16
8.3.10.0050.00518.98
8.3.00.0030.00619.63
8.2.180.0110.00416.88
8.2.170.0090.00622.96
8.2.160.0150.00021.32
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0040.00421.02
8.2.110.0070.00319.63
8.2.100.0040.00818.16
8.2.90.0030.00619.40
8.2.80.0040.00417.97
8.2.70.0030.00717.63
8.2.60.0000.00817.80
8.2.50.0060.00618.07
8.2.40.0050.00318.28
8.2.30.0050.00518.38
8.2.20.0100.00017.96
8.2.10.0000.00718.07
8.2.00.0030.00518.15
8.1.280.0110.00425.92
8.1.270.0000.00724.66
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00022.43
8.1.230.0060.00619.43
8.1.220.0040.00418.16
8.1.210.0040.00418.77
8.1.200.0070.00317.60
8.1.190.0030.00517.60
8.1.180.0040.00418.10
8.1.170.0060.00319.05
8.1.160.0040.00419.02
8.1.150.0000.00718.88
8.1.140.0060.00317.65
8.1.130.0070.00018.08
8.1.120.0000.00817.58
8.1.110.0040.00417.59
8.1.100.0070.00017.63
8.1.90.0050.00217.63
8.1.80.0000.00717.80
8.1.70.0070.00017.79
8.1.60.0050.00317.86
8.1.50.0050.00517.71
8.1.40.0040.00417.66
8.1.30.0000.00817.86
8.1.20.0000.00717.88
8.1.10.0040.00417.89
8.1.00.0040.00417.77
8.0.300.0040.00418.77
8.0.290.0080.00017.13
8.0.280.0000.00818.64
8.0.270.0000.00717.50
8.0.260.0040.00418.63
8.0.250.0040.00417.08
8.0.240.0030.00317.20
8.0.230.0040.00417.11
8.0.220.0030.00317.13
8.0.210.0000.00717.15
8.0.200.0060.00017.14
8.0.190.0000.00817.14
8.0.180.0050.00517.08
8.0.170.0040.00417.20
8.0.160.0040.00417.18
8.0.150.0000.01017.21
8.0.140.0030.00717.05
8.0.130.0030.00313.68
8.0.120.0050.00217.05
8.0.110.0080.00017.26
8.0.100.0080.00017.25
8.0.90.0040.00417.20
8.0.80.0000.01517.22
8.0.70.0080.00017.09
8.0.60.0050.00317.12
8.0.50.0050.00217.13
8.0.30.0070.01117.46
8.0.20.0150.00317.53
8.0.10.0000.00817.07
8.0.00.0130.00816.97
7.4.330.0000.00513.23
7.4.320.0000.00816.81
7.4.300.0000.00616.76
7.4.290.0040.00416.82
7.4.280.0030.00616.68
7.4.270.0050.00316.91
7.4.260.0000.00613.46
7.4.250.0080.00016.85
7.4.240.0030.00316.73
7.4.230.0030.00316.80
7.4.220.0090.01216.75
7.4.210.0070.00816.77
7.4.200.0000.00716.68
7.4.190.0000.00716.94
7.4.160.0060.01016.75
7.4.150.0090.00916.73
7.4.140.0120.00616.95
7.4.130.0120.00416.65
7.4.120.0140.00516.86
7.4.110.0070.01016.61
7.4.100.0030.01416.77
7.4.90.0040.01816.75
7.4.80.0130.00416.88
7.4.70.0070.01016.68
7.4.60.0100.01016.70
7.4.50.0050.00516.92
7.4.40.0030.01316.64
7.4.30.0080.01316.72
7.4.00.0110.00515.06
7.3.330.0030.00313.69
7.3.320.0030.00313.57
7.3.310.0000.00716.54
7.3.300.0030.00316.66
7.3.290.0160.00316.67
7.3.280.0110.00516.69
7.3.270.0070.01316.68
7.3.260.0040.01316.65
7.3.250.0110.00816.88
7.3.240.0080.01216.65
7.3.230.0170.00516.86
7.3.210.0070.01316.79
7.3.200.0070.01419.39
7.3.190.0120.00616.95
7.3.180.0120.00916.96
7.3.170.0060.00916.88
7.3.160.0130.01016.71
7.3.120.0080.00815.03
7.3.110.0060.00814.97
7.3.100.0080.00815.29
7.3.90.0080.00815.04
7.3.80.0050.00614.89
7.3.70.0070.00815.00
7.3.60.0070.01014.95
7.3.50.0060.00714.84
7.3.40.0080.00814.97
7.3.30.0040.01014.84
7.3.20.0060.00916.74
7.3.10.0040.00716.73
7.3.00.0030.01016.91
7.2.330.0060.01216.99
7.2.320.0120.00616.97
7.2.310.0110.01117.06
7.2.300.0060.01616.75
7.2.290.0090.00916.72
7.2.250.0100.00815.32
7.2.240.0080.01215.36
7.2.230.0100.00715.37
7.2.220.0040.01115.40
7.2.210.0070.01115.12
7.2.200.0100.00715.24
7.2.190.0060.00715.13
7.2.180.0030.00815.34
7.2.170.0060.01015.36
7.2.60.0040.01116.92
7.2.00.0070.00419.64
7.1.330.0030.01215.89
7.1.320.0060.00715.83
7.1.310.0040.01316.03
7.1.300.0080.00715.69
7.1.290.0050.00515.79
7.1.280.0070.00515.83
7.1.270.0040.00915.94
7.1.260.0000.01315.85
7.1.200.0000.01416.07
7.1.100.0060.00618.35
7.1.70.0030.01217.32
7.1.60.0080.00819.40
7.1.50.0130.01017.08
7.1.00.0070.05722.56
7.0.200.0160.00715.04
7.0.140.0000.07722.10
7.0.120.0000.07322.18
7.0.60.0130.05720.02
7.0.50.0100.05018.00
7.0.40.0030.06020.41
7.0.30.0500.07320.41
7.0.20.0170.04720.17
7.0.10.0100.08020.37
7.0.00.0030.04320.17
5.6.280.0100.07021.09
5.6.210.0130.07320.85
5.6.200.0070.08018.41
5.6.190.0070.04320.63
5.6.180.0370.07020.70
5.6.170.0300.08320.79
5.6.160.0070.07020.61
5.6.150.0030.06018.32
5.6.140.0030.08318.36
5.6.130.0070.05018.25
5.6.120.0000.04721.19
5.6.110.0070.08321.18
5.6.100.0030.07021.23
5.6.90.0070.08321.20
5.6.80.0100.07720.44
5.5.350.0070.08020.55
5.5.340.0030.08318.08
5.5.330.0000.05020.33
5.5.320.0370.07720.49
5.5.310.0330.07020.42
5.5.300.0130.07018.11
5.5.290.0000.08718.13
5.5.280.0000.04320.86
5.5.270.0130.08021.10
5.5.260.0100.07720.74
5.5.250.0070.08320.81
5.5.240.0270.07320.39
5.4.450.0170.04719.52
5.4.440.0030.08319.61
5.4.430.0070.05719.27
5.4.420.0030.07719.68
5.4.410.0130.06019.58
5.4.400.0100.06719.02
5.4.390.0000.04019.29
5.4.380.0100.03019.08
5.4.370.0000.04319.20
5.4.360.0100.03318.95
5.4.350.0000.04019.28
5.4.340.0100.04019.28
5.4.320.0000.04319.06
5.4.310.0000.04019.38
5.4.300.0030.03719.29
5.4.290.0030.04019.16
5.4.280.0000.04019.28
5.4.270.0030.03719.23
5.4.260.0030.04319.15
5.4.250.0030.03719.38
5.4.240.0030.03719.18
5.4.230.0070.03319.05
5.4.220.0000.04019.08
5.4.210.0030.03719.34
5.4.200.0070.03319.43
5.4.190.0070.03319.37
5.4.180.0030.03719.27
5.4.170.0170.03019.21
5.4.160.0070.05319.42
5.4.150.0070.03319.28
5.4.140.0030.03716.63
5.4.130.0100.07316.38
5.4.120.0030.04316.59
5.4.110.0030.04016.60
5.4.100.0070.07016.52
5.4.90.0030.07716.46
5.4.80.0070.04316.41
5.4.70.0130.06716.52
5.4.60.0030.04316.53
5.4.50.0100.06316.55
5.4.40.0100.07316.55
5.4.30.0100.03016.76
5.4.20.0100.07016.48
5.4.10.0070.06316.50
5.4.00.0030.04316.13
5.3.290.0030.04014.81
5.3.280.0030.03714.76
5.3.270.0100.03314.75
5.3.260.0030.03714.63
5.3.250.0070.04014.75
5.3.240.0070.06014.77
5.3.230.0000.08014.71
5.3.220.0000.05014.68
5.3.210.0100.06014.69
5.3.200.0130.03014.81
5.3.190.0070.06714.80
5.3.180.0070.04314.71
5.3.170.0130.03714.73
5.3.160.0030.07314.77
5.3.150.0030.04314.58
5.3.140.0030.05014.67
5.3.130.0000.08314.70
5.3.120.0030.07314.56
5.3.110.0130.07314.70
5.3.100.0100.07314.13
5.3.90.0100.07314.17
5.3.80.0100.03314.22
5.3.70.0000.07714.22
5.3.60.0130.06314.05
5.3.50.0130.06314.16
5.3.40.0070.06714.07
5.3.30.0170.06714.07
5.3.20.0000.07013.74
5.3.10.0070.08013.69
5.3.00.0100.06313.75
5.2.170.0100.03311.29
5.2.160.0070.05711.29
5.2.150.0030.06011.36
5.2.140.0070.03711.25
5.2.130.0130.05711.27
5.2.120.0070.06011.25
5.2.110.0100.04711.14
5.2.100.0070.03311.26
5.2.90.0030.06311.35
5.2.80.0070.03311.23
5.2.70.0070.05011.20
5.2.60.0030.06711.27
5.2.50.0030.04711.14
5.2.40.0070.05311.19
5.2.30.0070.06011.13
5.2.20.0100.04011.06
5.2.10.0070.06311.00
5.2.00.0000.06310.87
5.1.60.0030.05310.23
5.1.50.0030.06010.07
5.1.40.0030.05710.09
5.1.30.0030.06010.44
5.1.20.0030.04010.54
5.1.10.0070.05010.31
5.1.00.0030.05710.21
5.0.50.0030.0278.71
5.0.40.0030.0408.60
5.0.30.0000.0708.42
5.0.20.0030.0438.35
5.0.10.0030.0338.33
5.0.00.0070.0638.33
4.4.90.0030.0208.33
4.4.80.0100.0308.33
4.4.70.0000.0178.33
4.4.60.0030.0378.33
4.4.50.0100.0208.33
4.4.40.0000.0538.33
4.4.30.0000.0408.33
4.4.20.0000.0338.33
4.4.10.0030.0338.33
4.4.00.0070.0478.33
4.3.110.0070.0208.33
4.3.100.0070.0338.33
4.3.90.0030.0278.33
4.3.80.0070.0578.33
4.3.70.0070.0308.33
4.3.60.0000.0308.33
4.3.50.0070.0338.33
4.3.40.0000.0408.33
4.3.30.0000.0408.33
4.3.20.0000.0238.33
4.3.10.0000.0378.33
4.3.00.0000.0338.33

preferences:
44.05 ms | 400 KiB | 5 Q