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, ));*/ //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.0110.00425.92
8.3.50.0110.00725.92
8.3.40.0040.01125.92
8.2.180.0140.00025.92
8.2.170.0030.01325.92
8.1.280.0100.01025.92
7.4.10.0120.00314.84
7.4.00.0080.01015.28
7.3.130.0060.01015.28
7.3.120.0070.01214.90
7.3.110.0070.01414.63
7.3.100.0120.00315.05
7.3.90.0080.00814.88
7.3.80.0000.01514.88
7.3.70.0130.00315.09
7.3.60.0060.00315.02
7.3.50.0030.01414.89
7.3.40.0070.00714.95
7.3.30.0000.01315.09
7.3.20.0030.01516.58
7.3.10.0000.01116.68
7.3.00.0030.01216.86
7.2.260.0030.01715.50
7.2.250.0090.00615.30
7.2.240.0100.00715.34
7.2.230.0110.00715.09
7.2.220.0090.00915.12
7.2.210.0080.00815.30
7.2.200.0080.00815.23
7.2.190.0100.00715.27
7.2.180.0080.00815.34
7.2.170.0090.00615.12
7.2.160.0070.00715.45
7.2.150.0040.00717.06
7.2.140.0030.00717.13
7.2.130.0100.00317.19
7.2.120.0070.00316.80
7.2.110.0040.00817.03
7.2.100.0070.00716.92
7.2.90.0060.00317.11
7.2.80.0080.00817.05
7.2.70.0040.00816.75
7.2.60.0040.00817.03
7.2.50.0060.00917.11
7.2.40.0000.01316.87
7.2.30.0000.01417.00
7.2.20.0090.00517.14
7.2.10.0100.01017.41
7.2.00.0090.00617.27
7.1.330.0030.01416.00
7.1.320.0070.01016.03
7.1.310.0050.00515.95
7.1.300.0100.00315.75
7.1.290.0000.01615.88
7.1.280.0060.00615.87
7.1.270.0070.01016.13
7.1.260.0110.00416.00
7.1.250.0060.00315.77
7.1.240.0040.01216.01
7.1.230.0080.00415.91
7.1.220.0070.00715.82
7.1.210.0100.00016.05
7.1.200.0060.00716.01
7.1.190.0030.00915.75
7.1.180.0030.01016.05
7.1.170.0070.00715.63
7.1.160.0040.00815.79
7.1.150.0090.00315.85
7.1.140.0000.01116.06
7.1.130.0080.00515.81
7.1.120.0000.01015.84
7.1.110.0000.00915.77
7.1.100.0000.01416.24
7.1.90.0060.00315.98
7.1.80.0040.01415.89
7.1.70.0030.00916.73
7.1.60.0030.01517.56
7.1.50.0080.00516.49
7.1.40.0060.00316.08
7.1.30.0070.00716.10
7.1.20.0040.00415.80
7.1.10.0110.00015.63
7.1.00.0050.01819.19
7.0.330.0070.01415.60
7.0.320.0100.02215.23
7.0.310.0120.00815.50
7.0.300.0180.00915.74
7.0.290.0160.00915.48
7.0.280.0100.01015.71
7.0.270.0170.01415.51
7.0.260.0100.01615.73
7.0.250.0160.00715.60
7.0.240.0140.01115.57
7.0.230.0130.01715.65
7.0.220.0220.00315.59
7.0.210.0180.01115.47
7.0.200.0210.00715.28
7.0.190.0100.01015.57
7.0.180.0120.00915.58
7.0.170.0130.00715.63
7.0.160.0100.01315.56
7.0.150.0030.01615.61
7.0.140.0130.04018.98
7.0.130.0140.01415.51
7.0.120.0100.04518.79
7.0.110.0070.02015.65
7.0.100.0040.02215.66
7.0.90.0160.01515.62
7.0.80.0160.01015.23
7.0.70.0130.00915.38
7.0.60.0160.04017.71
7.0.50.0100.02316.79
7.0.40.0160.03717.04
7.0.30.0260.02716.91
7.0.20.0220.04017.01
7.0.10.0130.03316.99
7.0.00.0100.03216.78
5.6.400.0120.01214.91
5.6.390.0090.01314.60
5.6.380.0250.00614.47
5.6.370.0220.00714.66
5.6.360.0040.01814.85
5.6.350.0170.01314.82
5.6.340.0140.01414.68
5.6.330.0170.01314.29
5.6.320.0150.01414.71
5.6.310.0170.00714.97
5.6.300.0060.02214.43
5.6.290.0210.00014.76
5.6.280.0130.04217.88
5.6.270.0180.01414.71
5.6.260.0070.02114.50
5.6.250.0210.01014.45
5.6.240.0170.01314.82
5.6.230.0140.01414.43
5.6.220.0200.00714.75
5.6.210.0150.04617.56
5.6.200.0110.03216.40
5.6.190.0130.05017.69
5.6.180.0250.02017.50
5.6.170.0250.04217.65
5.6.160.0180.04617.60
5.6.150.0130.02616.41
5.6.140.0120.03516.46
5.6.130.0130.04216.38
5.6.120.0120.04018.04
5.6.110.0150.04517.81
5.6.100.0150.03117.84
5.6.90.0180.04117.75
5.6.80.0090.04217.67
5.6.70.0240.03817.40
5.6.60.0030.01614.34
5.6.50.0100.01014.61
5.6.40.0170.00014.26
5.6.30.0200.00314.26
5.6.20.0070.01314.38
5.6.10.0110.01414.48
5.6.00.0130.01314.49
5.5.380.0120.01914.67
5.5.370.0030.02314.55
5.5.360.0030.01914.78
5.5.350.0280.02417.50
5.5.340.0120.04716.31
5.5.330.0070.02817.52
5.5.320.0130.04217.56
5.5.310.0320.02817.43
5.5.300.0120.03216.40
5.5.290.0030.03816.40
5.5.280.0100.02717.67
5.5.270.0120.02317.89
5.5.260.0180.03317.79
5.5.250.0100.04217.66
5.5.240.0120.03817.44
5.5.230.0230.00714.47
5.5.220.0160.01014.52
5.5.210.0070.01814.34
5.5.200.0160.01014.46
5.5.190.0130.01014.48
5.5.180.0080.01213.98
5.5.170.0220.01014.61
5.5.160.0140.01014.44
5.5.150.0130.01014.55
5.5.140.0110.01414.30
5.5.130.0180.01114.55
5.5.120.0110.00914.41
5.5.110.0230.00714.61
5.5.100.0070.01714.55
5.5.90.0060.01214.31
5.5.80.0220.00314.60
5.5.70.0220.00314.37
5.5.60.0140.01114.54
5.5.50.0130.01714.50
5.5.40.0150.00614.50
5.5.30.0160.01014.13
5.5.20.0190.01314.63
5.5.10.0030.02814.47
5.5.00.0210.01014.53
5.4.450.0110.04415.26
5.4.440.0140.04315.54
5.4.430.0110.04315.35
5.4.420.0100.02315.54
5.4.410.0130.04515.51
5.4.400.0120.03315.32
5.4.390.0120.03815.28
5.4.380.0110.04615.22
5.4.370.0120.03015.16
5.4.360.0140.02515.11
5.4.350.0060.02515.24
5.4.340.0180.03815.06
5.4.330.0060.01911.09
5.4.320.0130.04315.28
5.4.310.0080.04315.08
5.4.300.0150.04315.22
5.4.290.0110.03515.27
5.4.280.0130.04615.36
5.4.270.0120.04315.28
5.4.260.0050.04915.02
5.4.250.0110.02315.48
5.4.240.0090.02615.34
5.4.230.0120.03315.23
5.4.220.0110.04515.10
5.4.210.0150.04215.10
5.4.200.0170.03815.29
5.4.190.0110.02615.21
5.4.180.0120.04515.42
5.4.170.0110.03215.25
5.4.160.0130.03815.12
5.4.150.0150.02215.04
5.4.140.0170.02214.00
5.4.130.0100.03213.99
5.4.120.0220.03413.87
5.4.110.0120.04313.82
5.4.100.0110.03313.94
5.4.90.0140.04113.90
5.4.80.0120.04213.91
5.4.70.0160.03513.96
5.4.60.0080.04313.84
5.4.50.0150.03513.83
5.4.40.0090.02513.96
5.4.30.0100.03813.80
5.4.20.0150.03713.99
5.4.10.0160.04214.00
5.4.00.0090.04313.51
5.3.290.0180.03012.97
5.3.280.0140.04212.85
5.3.270.0100.04112.91
5.3.260.0100.04712.97
5.3.250.0140.03212.92
5.3.240.0100.02812.95
5.3.230.0120.04312.92
5.3.220.0080.03712.93
5.3.210.0090.04812.91
5.3.200.0120.04112.91
5.3.190.0120.04012.89
5.3.180.0170.02212.90
5.3.170.0140.03912.89
5.3.160.0170.03912.95
5.3.150.0120.04412.94
5.3.140.0070.02912.87
5.3.130.0090.04512.92
5.3.120.0130.02312.89
5.3.110.0160.02812.92
5.3.100.0130.04212.64
5.3.90.0100.02212.63
5.3.80.0140.02012.62
5.3.70.0130.04012.63
5.3.60.0030.03512.57
5.3.50.0090.03912.54
5.3.40.0120.03212.59
5.3.30.0190.03512.62
5.3.20.0170.02512.44
5.3.10.0190.03212.47
5.3.00.0100.03212.47
5.2.170.0100.03711.38
5.2.160.0100.06311.29
5.2.150.0100.05311.34
5.2.140.0070.06711.41
5.2.130.0170.06011.25
5.2.120.0130.04311.25
5.2.110.0100.05311.11
5.2.100.0030.03311.35
5.2.90.0100.06311.34
5.2.80.0030.04011.29
5.2.70.0070.04011.14
5.2.60.0070.06311.21
5.2.50.0100.04011.27
5.2.40.0070.06711.03
5.2.30.0070.06311.02
5.2.20.0170.04011.10
5.2.10.0130.05311.05
5.2.00.0030.06710.82
5.1.60.0130.04710.09
5.1.50.0070.03710.23
5.1.40.0070.05710.07
5.1.30.0100.03710.37
5.1.20.0030.06710.55
5.1.10.0100.03010.06
5.1.00.0130.05010.23
5.0.50.0030.0239.60
5.0.40.0100.0479.60
5.0.30.0070.0309.60
5.0.20.0170.0409.60
5.0.10.0030.0439.60
5.0.00.0100.0639.60
4.4.90.0000.0279.25
4.4.80.0030.0279.25
4.4.70.0030.0209.30
4.4.60.0030.0309.30
4.4.50.0030.0239.30
4.4.40.0000.0579.60
4.4.30.0000.0179.60
4.4.20.0000.0309.60
4.4.10.0000.0179.60
4.4.00.0000.0379.60
4.3.110.0000.0309.60
4.3.100.0000.0239.60
4.3.90.0070.0309.60
4.3.80.0030.0379.60
4.3.70.0000.0379.60
4.3.60.0030.0379.60
4.3.50.0000.0439.60
4.3.40.0030.0539.60
4.3.30.0030.0179.60
4.3.20.0000.0379.60
4.3.10.0000.0379.60
4.3.00.0000.0339.60

preferences:
42.72 ms | 400 KiB | 5 Q