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.0140.00716.87
8.3.50.0090.00917.59
8.3.40.0150.00019.04
8.3.30.0060.00919.05
8.3.20.0100.00718.89
8.3.10.0050.00320.86
8.3.00.0060.00317.88
8.2.180.0070.01416.88
8.2.170.0070.00722.96
8.2.160.0090.00620.63
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00720.08
8.2.110.0000.01022.50
8.2.100.0090.00317.91
8.2.90.0000.00819.22
8.2.80.0060.00318.12
8.2.70.0000.00817.63
8.2.60.0000.00818.16
8.2.50.0000.00818.07
8.2.40.0040.00418.34
8.2.30.0000.00718.31
8.2.20.0040.00417.90
8.2.10.0030.00519.67
8.2.00.0080.00018.00
8.1.280.0070.01125.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0060.01222.70
8.1.230.0070.00421.30
8.1.220.0000.00818.77
8.1.210.0060.00319.13
8.1.200.0060.00317.63
8.1.190.0040.00417.77
8.1.180.0060.00318.10
8.1.170.0000.00819.22
8.1.160.0000.00719.08
8.1.150.0050.00318.79
8.1.140.0040.00417.57
8.1.130.0030.00318.08
8.1.120.0030.00317.61
8.1.110.0040.00417.77
8.1.100.0050.00217.79
8.1.90.0040.00417.76
8.1.80.0000.00717.75
8.1.70.0000.00717.68
8.1.60.0050.00217.76
8.1.50.0040.00417.75
8.1.40.0020.00517.65
8.1.30.0000.00817.95
8.1.20.0050.00317.85
8.1.10.0040.00417.70
8.1.00.0040.00417.60
8.0.300.0000.00920.23
8.0.290.0040.00417.00
8.0.280.0070.00018.52
8.0.270.0030.00317.33
8.0.260.0070.00017.07
8.0.250.0040.00417.15
8.0.240.0060.00617.13
8.0.230.0040.00317.24
8.0.220.0020.00517.14
8.0.210.0040.00417.00
8.0.200.0000.00617.10
8.0.190.0000.00717.18
8.0.180.0070.00017.23
8.0.170.0050.00317.11
8.0.160.0000.00717.16
8.0.150.0060.00317.06
8.0.140.0040.00717.18
8.0.130.0030.00313.58
8.0.120.0080.00017.16
8.0.110.0000.00717.09
8.0.100.0070.00017.21
8.0.90.0050.00317.10
8.0.80.0090.00917.14
8.0.70.0000.00817.10
8.0.60.0000.00717.25
8.0.50.0030.00517.16
8.0.30.0110.01017.27
8.0.20.0110.01317.26
8.0.10.0050.00217.19
8.0.00.0120.00617.01
7.4.330.0060.00013.16
7.4.320.0080.00016.77
7.4.300.0030.00316.86
7.4.290.0000.00716.77
7.4.280.0070.00316.76
7.4.270.0050.00216.84
7.4.260.0060.00013.52
7.4.250.0040.00416.77
7.4.240.0080.00016.81
7.4.230.0070.00016.78
7.4.220.0060.01816.80
7.4.210.0100.00716.79
7.4.200.0040.00416.73
7.4.190.0050.00316.73
7.4.160.0030.02316.75
7.4.150.0170.01416.88
7.4.140.0090.01416.73
7.4.130.0110.01416.92
7.4.120.0160.00716.91
7.4.110.0130.00716.65
7.4.100.0190.00616.79
7.4.90.0190.01316.64
7.4.80.0160.00416.91
7.4.70.0140.01416.69
7.4.60.0150.00616.54
7.4.50.0100.00016.92
7.4.40.0040.01216.83
7.4.30.0210.00316.80
7.4.00.0030.01515.05
7.3.330.0030.00313.67
7.3.320.0030.00313.67
7.3.310.0040.00416.79
7.3.300.0000.00816.66
7.3.290.0160.00016.64
7.3.280.0120.01016.67
7.3.270.0140.00916.65
7.3.260.0120.01116.79
7.3.250.0110.01416.65
7.3.240.0180.01116.70
7.3.230.0110.01116.88
7.3.210.0170.00316.66
7.3.200.0150.00619.39
7.3.190.0190.00616.86
7.3.180.0060.01216.94
7.3.170.0100.01016.91
7.3.160.0120.01216.58
7.3.120.0070.01315.18
7.3.110.0130.00714.93
7.3.100.0100.01014.96
7.3.90.0070.01015.23
7.3.80.0060.01615.06
7.3.70.0030.01014.73
7.3.60.0000.01614.85
7.3.50.0070.00715.02
7.3.40.0120.00014.99
7.3.30.0070.01014.93
7.3.20.0070.01416.79
7.3.10.0080.00616.69
7.3.00.0090.00816.70
7.2.330.0170.00617.00
7.2.320.0150.01517.02
7.2.310.0090.01516.86
7.2.300.0160.00416.76
7.2.290.0090.01217.05
7.2.250.0030.01715.29
7.2.240.0070.01115.43
7.2.230.0100.00615.08
7.2.220.0090.00615.16
7.2.210.0100.01015.16
7.2.200.0050.00515.01
7.2.190.0090.00615.15
7.2.180.0100.01015.04
7.2.170.0000.01414.91
7.2.160.0030.01015.18
7.2.150.0060.01017.26
7.2.140.0070.00716.96
7.2.130.0130.00416.83
7.2.120.0100.00716.95
7.2.110.0080.00716.93
7.2.100.0070.00916.88
7.2.90.0130.00617.01
7.2.80.0100.00816.85
7.2.70.0100.01116.95
7.2.60.0080.00716.98
7.2.50.0120.00816.98
7.2.40.0130.00617.04
7.2.30.0110.00616.99
7.2.20.0140.00616.96
7.2.10.0090.01016.99
7.2.00.0090.01017.58
7.1.330.0090.00915.97
7.1.320.0090.00616.02
7.1.310.0030.01616.16
7.1.300.0070.00715.56
7.1.290.0130.00615.98
7.1.280.0030.01015.86
7.1.270.0040.01415.98
7.1.260.0060.00316.12
7.1.250.0060.01215.79
7.1.240.0040.01215.84
7.1.230.0000.01915.93
7.1.220.0000.01415.90
7.1.210.0110.00615.89
7.1.200.0050.01015.96
7.1.190.0070.00715.90
7.1.180.0100.00715.98
7.1.170.0030.01316.06
7.1.160.0150.00615.87
7.1.150.0090.00916.00
7.1.140.0060.00615.90
7.1.130.0070.01115.79
7.1.120.0060.00615.90
7.1.110.0070.00715.96
7.1.100.0060.00917.29
7.1.90.0040.01216.13
7.1.80.0040.01115.85
7.1.70.0060.00516.72
7.1.60.0070.01117.66
7.1.50.0120.00616.38
7.1.40.0060.00916.08
7.1.30.0030.01016.18
7.1.20.0080.00815.77
7.1.10.0090.00315.97
7.1.00.0070.04019.28
7.0.330.0060.00915.50
7.0.320.0030.01215.48
7.0.310.0090.00615.50
7.0.300.0000.01515.60
7.0.290.0070.00715.70
7.0.280.0090.00615.71
7.0.270.0090.00615.44
7.0.260.0000.01415.50
7.0.250.0060.00915.68
7.0.240.0090.00615.53
7.0.230.0040.01115.68
7.0.220.0040.01115.71
7.0.210.0120.00315.71
7.0.200.0060.00516.16
7.0.190.0120.00015.59
7.0.180.0030.01015.63
7.0.170.0030.01215.66
7.0.160.0110.00415.58
7.0.150.0030.01015.57
7.0.140.0050.03818.69
7.0.130.0030.01315.58
7.0.120.0070.04018.83
7.0.110.0040.01515.66
7.0.100.0130.00315.51
7.0.90.0000.01415.66
7.0.80.0100.00615.65
7.0.70.0090.00615.42
7.0.60.0140.03817.72
7.0.50.0050.04216.70
7.0.40.0070.02616.84
7.0.30.0150.03916.91
7.0.20.0210.04316.92
7.0.10.0200.03017.03
7.0.00.0100.04216.96
5.6.400.0040.00714.83
5.6.390.0090.00914.59
5.6.380.0100.00014.52
5.6.370.0000.01214.22
5.6.360.0070.00714.55
5.6.350.0030.00615.00
5.6.340.0090.00914.88
5.6.330.0130.00614.50
5.6.320.0060.00914.50
5.6.310.0030.00914.69
5.6.300.0030.00714.63
5.6.290.0070.00714.95
5.6.280.0050.04217.84
5.6.270.0090.00914.49
5.6.260.0070.01014.60
5.6.250.0120.00314.54
5.6.240.0090.00614.96
5.6.230.0130.00714.70
5.6.220.0030.01314.75
5.6.210.0050.04317.66
5.6.200.0070.04316.41
5.6.190.0100.03117.50
5.6.180.0220.03817.72
5.6.170.0240.04017.55
5.6.160.0050.03317.61
5.6.150.0100.04316.37
5.6.140.0070.04716.42
5.6.130.0110.03016.42
5.6.120.0030.03517.87
5.6.110.0070.02617.82
5.6.100.0150.04017.86
5.6.90.0050.04017.82
5.6.80.0120.04417.46
5.6.70.1480.02217.64
5.6.60.0030.00914.79
5.6.50.0070.00714.16
5.6.40.0070.01414.78
5.6.30.0070.00314.45
5.6.20.0110.00414.51
5.6.10.0100.00314.79
5.6.00.0060.00614.55
5.5.380.0090.00914.59
5.5.370.0140.00414.88
5.5.360.0060.01214.38
5.5.350.0200.03217.47
5.5.340.0130.03916.47
5.5.330.0070.02617.39
5.5.320.0190.03917.57
5.5.310.0200.03717.63
5.5.300.0100.02516.28
5.5.290.0060.03016.49
5.5.280.0000.03617.76
5.5.270.0050.02617.86
5.5.260.0030.03317.62
5.5.250.0110.04117.75
5.5.240.0110.02617.24
5.5.230.0080.01214.40
5.5.220.0000.01914.37
5.5.210.0030.01014.55
5.5.200.0080.00814.57
5.5.190.0030.00614.51
5.5.180.0070.00714.55
5.5.170.0040.00814.57
5.5.160.0000.01414.32
5.5.150.0040.01114.34
5.5.140.0060.00914.76
5.5.130.0030.01314.52
5.5.120.0070.00714.63
5.5.110.0040.01114.48
5.5.100.0170.00314.31
5.5.90.0000.01214.66
5.5.80.0060.01014.46
5.5.70.0030.00714.48
5.5.60.0110.00614.30
5.5.50.0060.00914.55
5.5.40.0030.00714.61
5.5.30.0030.00714.44
5.5.20.0100.00714.60
5.5.10.0030.01214.20
5.5.00.0070.00714.19
5.4.450.0110.04115.99
5.4.440.0110.04116.09
5.4.430.0050.03016.17
5.4.420.0030.02215.98
5.4.410.0020.03315.86
5.4.400.0130.02215.88
5.4.390.0070.03915.75
5.4.380.0020.03015.88
5.4.370.0070.04515.96
5.4.360.0140.03215.89
5.4.350.0080.03015.97
5.4.340.0100.04015.86
5.4.330.0030.01112.57
5.4.320.0090.02115.82
5.4.310.0040.02415.92
5.4.300.0020.04515.96
5.4.290.0060.02815.92
5.4.280.0000.04815.76
5.4.270.0050.02715.81
5.4.260.0050.04215.83
5.4.250.0090.02215.98
5.4.240.0050.02715.92
5.4.230.0020.04515.82
5.4.220.0080.03715.97
5.4.210.0060.04315.74
5.4.200.0080.04215.95
5.4.190.0090.03816.00
5.4.180.0050.03315.93
5.4.170.0050.02915.94
5.4.160.0000.02715.92
5.4.150.0060.04215.96
5.4.140.0050.02814.48
5.4.130.0110.01914.57
5.4.120.0120.03214.62
5.4.110.0040.02814.50
5.4.100.0040.02014.49
5.4.90.0100.03714.59
5.4.80.0030.02914.55
5.4.70.0090.02714.57
5.4.60.0050.03714.66
5.4.50.0050.02514.54
5.4.40.0040.02714.63
5.4.30.0030.03814.57
5.4.20.0120.03714.50
5.4.10.0050.01814.54
5.4.00.0040.02214.30
5.3.290.0030.02713.67
5.3.280.0080.02013.63
5.3.270.0070.04013.66
5.3.260.0050.04013.69
5.3.250.0080.03313.69
5.3.240.0050.03513.71
5.3.230.0080.03513.66
5.3.220.0030.03013.65
5.3.210.0020.02413.62
5.3.200.0040.02013.67
5.3.190.0020.04313.69
5.3.180.0050.03713.61
5.3.170.0060.02613.64
5.3.160.0050.03613.68
5.3.150.0030.03913.63
5.3.140.0050.04213.66
5.3.130.0080.03613.62
5.3.120.0050.03713.56
5.3.110.0030.02213.63
5.3.100.0020.02613.40
5.3.90.0020.02413.30
5.3.80.0050.02013.41
5.3.70.0020.02413.41
5.3.60.0050.02113.40
5.3.50.0050.02013.36
5.3.40.0100.01713.38
5.3.30.0050.02013.34
5.3.20.0080.01813.16
5.3.10.0030.02013.13
5.3.00.0030.02213.22
5.2.170.0000.03011.30
5.2.160.0030.02711.31
5.2.150.0000.03011.29
5.2.140.0100.02011.20
5.2.130.0000.03311.23
5.2.120.0070.02311.30
5.2.110.0000.03011.14
5.2.100.0000.03011.25
5.2.90.0030.03011.14
5.2.80.0030.03011.13
5.2.70.0000.03011.13
5.2.60.0000.03011.28
5.2.50.0030.02711.05
5.2.40.0030.02711.03
5.2.30.0000.03011.00
5.2.20.0070.02311.00
5.2.10.0030.03010.96
5.2.00.0070.02310.88
5.1.60.0000.02710.10
5.1.50.0030.02310.14
5.1.40.0000.02710.11
5.1.30.0030.02310.50
5.1.20.0030.03010.36
5.1.10.0030.02310.23
5.1.00.0000.03010.23
5.0.50.0030.0178.61
5.0.40.0000.0208.61
5.0.30.0000.0308.42
5.0.20.0030.0178.42
5.0.10.0100.0108.42
5.0.00.0030.0278.42
4.4.90.0030.0138.42
4.4.80.0000.0178.42
4.4.70.0000.0178.42
4.4.60.0000.0138.42
4.4.50.0000.0178.42
4.4.40.0030.0208.42
4.4.30.0000.0138.42
4.4.20.0030.0138.42
4.4.10.0000.0178.42
4.4.00.0000.0238.42
4.3.110.0000.0208.42
4.3.100.0000.0138.42
4.3.90.0000.0138.42
4.3.80.0000.0308.42
4.3.70.0000.0178.42
4.3.60.0000.0208.42
4.3.50.0000.0208.42
4.3.40.0000.0438.42
4.3.30.0000.0208.42
4.3.20.0030.0338.42
4.3.10.0030.0278.42
4.3.00.0030.0238.42

preferences:
43.89 ms | 401 KiB | 5 Q