3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Recurse1($xml) { foreach ($xml->children() as $child) { if (is_iterable($child)) { if (!isset($array)) { $array = Recurse1($child); } else { $array = array_merge($array, Recurse1($child)); } } 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.00018.70
8.3.50.0040.01118.18
8.3.40.0120.00318.96
8.3.30.0030.01318.96
8.3.20.0000.01819.52
8.3.10.0050.00321.97
8.3.00.0040.00420.92
8.2.180.0110.00719.04
8.2.170.0060.00922.96
8.2.160.0100.01020.47
8.2.150.0100.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00418.28
8.2.120.0080.00026.35
8.2.110.0070.00319.65
8.2.100.0110.00017.97
8.2.90.0050.00518.00
8.2.80.0030.00518.00
8.2.70.0040.00418.05
8.2.60.0050.00318.34
8.2.50.0000.00818.10
8.2.40.0090.00021.27
8.2.30.0090.00019.56
8.2.20.0000.00818.34
8.2.10.0000.00818.23
8.2.00.0060.00317.97
8.1.280.0060.01325.92
8.1.270.0080.00018.97
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.34
8.1.230.0000.01122.30
8.1.220.0000.00817.91
8.1.210.0000.00918.77
8.1.200.0030.00717.47
8.1.190.0080.00017.34
8.1.180.0040.00418.10
8.1.170.0000.00918.88
8.1.160.0060.00318.98
8.1.150.0000.00719.04
8.1.140.0070.00022.32
8.1.130.0030.00322.20
8.1.120.0000.00717.67
8.1.110.0040.00417.67
8.1.100.0000.00817.62
8.1.90.0040.00417.72
8.1.80.0070.00017.70
8.1.70.0000.00717.63
8.1.60.0040.00417.80
8.1.50.0000.00817.81
8.1.40.0000.00817.81
8.1.30.0030.00617.78
8.1.20.0000.00817.73
8.1.10.0080.00017.82
8.1.00.0000.00717.72
8.0.300.0030.00618.77
8.0.290.0040.00417.00
8.0.280.0000.00718.67
8.0.270.0070.00017.47
8.0.260.0060.00018.65
8.0.250.0070.00017.15
8.0.240.0050.00317.10
8.0.230.0070.00017.09
8.0.220.0030.00317.12
8.0.210.0000.00717.07
8.0.200.0070.00017.21
8.0.190.0000.00717.26
8.0.180.0080.00017.19
8.0.170.0000.01017.25
8.0.160.0000.00817.15
8.0.150.0000.00716.97
8.0.140.0030.00317.06
8.0.130.0000.00613.52
8.0.120.0080.00017.20
8.0.110.0040.00417.18
8.0.100.0000.00717.18
8.0.90.0000.00717.09
8.0.80.0070.01317.15
8.0.70.0050.00216.98
8.0.60.0030.00517.18
8.0.50.0050.00217.04
8.0.30.0110.00817.32
8.0.20.0090.00917.40
8.0.10.0000.00717.38
8.0.00.0120.01017.13
7.4.330.0040.00415.55
7.4.320.0040.00416.64
7.4.300.0030.00316.89
7.4.290.0030.00316.70
7.4.280.0040.00816.82
7.4.270.0030.00316.80
7.4.260.0040.00316.66
7.4.250.0000.00716.68
7.4.240.0040.00416.89
7.4.230.0000.00716.54
7.4.220.0050.00316.82
7.4.210.0040.01116.83
7.4.200.0040.00416.58
7.4.160.0070.00916.75
7.4.140.0110.00717.86
7.4.130.0140.00616.81
7.4.120.0140.00616.73
7.4.110.0060.01216.91
7.4.100.0120.00616.75
7.4.90.0100.00716.92
7.4.80.0100.01019.39
7.4.70.0100.00616.70
7.4.60.0040.01316.61
7.4.50.0110.00616.58
7.4.40.0110.00616.66
7.4.00.0060.01015.10
7.3.330.0000.00613.32
7.3.320.0030.00313.29
7.3.310.0080.00016.54
7.3.300.0030.00316.39
7.3.290.0070.00016.49
7.3.280.0050.01016.48
7.3.260.0090.01116.72
7.3.240.0080.01316.60
7.3.230.0100.00716.61
7.3.210.0030.01416.50
7.3.200.0070.01016.61
7.3.190.0070.01116.72
7.3.180.0110.00716.55
7.3.170.0100.01416.77
7.3.160.0100.01016.73
7.3.10.0170.00716.25
7.3.00.0120.00916.10
7.2.330.0110.00917.00
7.2.320.0170.00016.92
7.2.310.0090.00916.88
7.2.300.0060.00917.06
7.2.290.0060.01016.71
7.2.130.0120.01216.12
7.2.120.0130.01316.33
7.2.110.0250.01315.63
7.2.100.0250.01015.77
7.2.90.0250.01115.70
7.2.80.0350.01015.66
7.2.70.0370.00515.96
7.2.60.0290.01015.83
7.2.50.0290.00516.24
7.2.40.0330.01016.01
7.2.30.0320.00915.71
7.2.20.0270.00915.69
7.2.10.0410.00315.82
7.2.00.0360.01115.97
7.1.250.0140.01015.36
7.1.230.0610.00613.99
7.1.220.0440.00314.03
7.1.210.0490.00313.99
7.1.200.0440.00614.05
7.1.190.0670.00413.96
7.1.180.0330.01014.02
7.1.170.0400.00313.98
7.1.160.0430.00313.98
7.1.150.0390.01014.09
7.1.140.0510.01214.07
7.1.130.0550.00713.66
7.1.120.0640.01513.66
7.1.110.0520.00314.00
7.1.100.1030.00313.64
7.1.90.0660.00913.93
7.1.80.0640.01313.92
7.1.70.0470.01313.96
7.1.60.0860.00331.95
7.1.50.1250.00731.73
7.1.40.0840.01031.76
7.1.30.0770.01332.02
7.1.20.0960.01331.59
7.1.10.0840.00613.65
7.1.00.0610.00314.07
5.6.380.0040.01014.66

preferences:
45.6 ms | 400 KiB | 5 Q