3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Recurse1($xml, $array = []) { foreach ($xml->children() as $child) { if (is_iterable($child)) { $array = array_merge($array, Recurse1($child, $array)); } else { $array[] = (string)$xml['role']; } } return $array; } $xml = new SimpleXMLElement( '<person> <child role="son1"> <child role="daughter1"/> </child> <child role="daughter2"> <child role="son2"> <child role="son3"/> </child> </child> </person>'); var_dump(Recurse1($xml));

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.0150.00618.43
8.3.50.0110.00418.37
8.3.40.0120.00318.74
8.3.30.0110.00418.72
8.3.20.0100.00719.41
8.3.10.0050.00321.98
8.3.00.0040.00420.74
8.2.180.0060.00918.79
8.2.170.0070.01122.96
8.2.160.0100.01020.55
8.2.150.0060.00324.18
8.2.140.0070.00024.66
8.2.130.0040.00418.09
8.2.120.0030.00526.35
8.2.110.0070.00321.11
8.2.100.0090.00318.34
8.2.90.0040.00417.88
8.2.80.0030.00617.97
8.2.70.0000.00818.18
8.2.60.0030.00518.34
8.2.50.0060.00318.10
8.2.40.0000.00819.36
8.2.30.0000.00719.56
8.2.20.0070.00018.21
8.2.10.0000.00818.13
8.2.00.0060.00317.91
8.1.280.0100.01025.92
8.1.270.0080.00018.80
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00322.37
8.1.230.0190.00019.06
8.1.220.0000.00817.89
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0040.00418.76
8.1.160.0090.00019.08
8.1.150.0040.00419.07
8.1.140.0050.00322.29
8.1.130.0000.00722.25
8.1.120.0040.00417.64
8.1.110.0000.00817.74
8.1.100.0070.00017.57
8.1.90.0030.00517.69
8.1.80.0040.00417.75
8.1.70.0040.00417.56
8.1.60.0030.00517.79
8.1.50.0080.00017.61
8.1.40.0030.00617.69
8.1.30.0040.00417.91
8.1.20.0040.00417.89
8.1.10.0040.00417.65
8.1.00.0040.00417.79
8.0.300.0030.00618.77
8.0.290.0040.00416.88
8.0.280.0000.00718.64
8.0.270.0030.00317.45
8.0.260.0000.00618.65
8.0.250.0030.00317.03
8.0.240.0000.00817.09
8.0.230.0070.00017.02
8.0.220.0000.00716.96
8.0.210.0000.00816.98
8.0.200.0030.00517.07
8.0.190.0000.00717.21
8.0.180.0030.00516.96
8.0.170.0000.00917.02
8.0.160.0070.00017.05
8.0.150.0000.00716.87
8.0.140.0050.00217.05
8.0.130.0000.00613.57
8.0.120.0050.00316.95
8.0.110.0050.00217.18
8.0.100.0040.00417.11
8.0.90.0040.00416.97
8.0.80.0110.00917.04
8.0.70.0040.00416.91
8.0.60.0050.00217.09
8.0.50.0020.00516.98
8.0.30.0090.00917.11
8.0.20.0120.00617.40
8.0.10.0000.00717.02
8.0.00.0090.01516.97
7.4.330.0060.00015.55
7.4.320.0060.00016.74
7.4.300.0040.00416.79
7.4.290.0000.00716.73
7.4.280.0030.00716.71
7.4.270.0000.00716.66
7.4.260.0000.01016.76
7.4.250.0000.00816.63
7.4.240.0050.00316.73
7.4.230.0040.00416.52
7.4.220.0040.00416.57
7.4.210.0100.00516.80
7.4.200.0040.00416.82
7.4.160.0080.00816.71
7.4.140.0130.00717.86
7.4.130.0170.00016.76
7.4.120.0120.00816.80
7.4.110.0130.00616.68
7.4.100.0120.00616.76
7.4.90.0090.00816.92
7.4.80.0060.01719.39
7.4.70.0110.00616.55
7.4.60.0060.01316.91
7.4.50.0060.00916.47
7.4.40.0110.01116.80
7.4.00.0030.01214.93
7.3.330.0000.00513.44
7.3.320.0030.00313.43
7.3.310.0000.00816.40
7.3.300.0030.00316.30
7.3.290.0030.00316.25
7.3.280.0120.00516.43
7.3.260.0150.00716.57
7.3.240.0080.01116.61
7.3.230.0090.00916.48
7.3.210.0110.00616.56
7.3.200.0100.00616.65
7.3.190.0200.01216.64
7.3.180.0110.00816.65
7.3.170.0090.01516.62
7.3.160.0060.01116.48
7.3.10.0090.00616.69
7.3.00.0030.01216.18
7.2.330.0180.00316.93
7.2.320.0150.00917.00
7.2.310.0060.01216.95
7.2.300.0070.01016.85
7.2.290.0080.00816.68
7.2.130.0030.01016.91
7.2.120.0000.01216.79
7.2.110.0140.00715.74
7.2.100.0220.00715.82
7.2.90.0550.00715.78
7.2.80.0120.01015.75
7.2.70.0150.00716.09
7.2.60.0160.00715.95
7.2.50.0150.00715.91
7.2.40.0200.01215.83
7.2.30.0190.00615.70
7.2.20.0250.00316.10
7.2.10.0140.01116.15
7.2.00.0110.00615.96
7.1.250.0100.00315.57
7.1.230.0320.01013.86
7.1.220.0180.00613.77
7.1.210.0200.00613.73
7.1.200.0270.01014.03
7.1.190.0220.00614.09
7.1.180.0310.00314.04
7.1.170.0310.00914.19
7.1.160.0150.00914.00
7.1.150.0290.00613.98
7.1.140.0130.01313.97
7.1.130.0250.00313.98
7.1.120.0230.00714.05
7.1.110.0260.00314.00
7.1.100.0260.00613.85
7.1.90.0210.01213.98
7.1.80.0210.00913.70
7.1.70.0150.01113.72
7.1.60.0340.01331.88
7.1.50.0340.01331.70
7.1.40.1270.01031.91
7.1.30.0510.01031.95
7.1.20.0560.01331.68
7.1.10.0310.00713.46
7.1.00.0270.01013.73
5.6.380.0070.00714.31

preferences:
51.76 ms | 401 KiB | 5 Q