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)); } 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.40.0120.00418.67
8.3.30.0000.01518.82
8.3.20.0120.00619.29
8.3.10.0080.00022.10
8.3.00.0050.00320.89
8.2.170.0120.00322.96
8.2.160.0070.00720.57
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00018.28
8.2.120.0040.00426.35
8.2.110.0030.00619.42
8.2.100.0040.00819.76
8.2.90.0100.00317.75
8.2.80.0040.00417.97
8.2.70.0050.00318.17
8.2.60.0090.00018.28
8.2.50.0030.00618.10
8.2.40.0030.00619.59
8.2.30.0040.00419.46
8.2.20.0000.00818.34
8.2.10.0070.00018.23
8.2.00.0030.00617.91
8.1.270.0060.00319.14
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0100.00022.38
8.1.230.0040.00722.34
8.1.220.0000.00817.89
8.1.210.0050.00318.77
8.1.200.0060.00317.37
8.1.190.0050.00317.25
8.1.180.0080.00018.10
8.1.170.0050.00318.76
8.1.160.0000.00918.96
8.1.150.0040.00419.09
8.1.140.0030.00622.35
8.1.130.0070.00022.15
8.1.120.0000.00717.56
8.1.110.0040.00417.71
8.1.100.0000.00717.56
8.1.90.0030.00417.77
8.1.80.0060.00317.70
8.1.70.0050.00217.68
8.1.60.0020.00517.81
8.1.50.0080.00017.68
8.1.40.0080.00017.77
8.1.30.0050.00317.84
8.1.20.0060.00317.88
8.1.10.0040.00417.64
8.1.00.0040.00417.58
8.0.300.0070.00018.77
8.0.290.0070.00016.88
8.0.280.0000.00718.67
8.0.270.0000.00717.35
8.0.260.0030.00318.66
8.0.250.0000.00817.05
8.0.240.0000.00717.18
8.0.230.0070.00017.05
8.0.220.0040.00417.12
8.0.210.0000.00717.07
8.0.200.0000.00717.18
8.0.190.0070.00017.20
8.0.180.0040.00416.99
8.0.170.0060.00317.04
8.0.160.0040.00417.05
8.0.150.0030.00517.08
8.0.140.0040.00417.09
8.0.130.0000.00513.60
8.0.120.0080.00016.96
8.0.110.0080.00017.12
8.0.100.0050.00216.84
8.0.90.0040.00416.89
8.0.80.0100.00917.01
8.0.70.0000.00717.07
8.0.60.0060.00316.98
8.0.50.0000.00816.99
8.0.30.0130.00317.10
8.0.20.0140.01117.48
8.0.10.0040.00417.10
8.0.00.0190.00716.94
7.4.330.0040.00315.55
7.4.320.0040.00416.80
7.4.300.0070.00016.78
7.4.290.0030.00316.71
7.4.280.0030.00716.63
7.4.270.0050.00316.68
7.4.260.0030.00316.72
7.4.250.0040.00416.83
7.4.240.0050.00216.70
7.4.230.0040.00416.86
7.4.220.0000.00716.76
7.4.210.0090.00516.78
7.4.200.0000.00716.76
7.4.160.0090.01116.64
7.4.140.0130.00617.86
7.4.130.0120.00616.81
7.4.120.0100.00916.78
7.4.110.0140.00316.54
7.4.100.0100.00716.67
7.4.90.0070.01016.65
7.4.80.0140.00819.39
7.4.70.0150.00016.72
7.4.60.0140.00316.70
7.4.50.0110.01016.68
7.4.40.0150.00616.56
7.4.00.0000.01415.18
7.3.330.0000.00613.46
7.3.320.0050.00013.43
7.3.310.0080.00016.25
7.3.300.0030.00316.40
7.3.290.0040.00416.44
7.3.280.0080.00916.43
7.3.260.0090.00916.49
7.3.240.0070.00916.56
7.3.230.0080.00816.59
7.3.210.0100.00716.67
7.3.200.0110.00616.67
7.3.190.0090.00816.49
7.3.180.0100.01016.53
7.3.170.0110.01116.48
7.3.160.0100.01016.50
7.3.120.0030.01014.72
7.3.110.0060.00614.59
7.3.100.0040.00814.88
7.3.90.0030.01114.94
7.3.80.0130.00014.86
7.3.70.0140.00314.79
7.3.60.0030.01014.75
7.3.50.0040.00814.67
7.3.40.0040.01114.87
7.3.30.0060.00814.93
7.3.20.0040.01116.62
7.3.10.0080.00516.58
7.3.00.0050.00516.66
7.2.330.0110.00716.67
7.2.320.0030.01416.93
7.2.310.0100.00717.03
7.2.300.0150.00316.74
7.2.290.0080.00816.89
7.2.240.0060.00915.32
7.2.230.0060.01215.24
7.2.220.0130.00015.18
7.2.210.0130.00315.29
7.2.200.0000.01815.17
7.2.190.0040.01115.24
7.2.180.0040.01114.78
7.2.170.0030.01315.13
7.2.160.0000.01515.03
7.2.150.0030.01216.98
7.2.140.0030.00917.14
7.2.130.0070.00617.03
7.2.120.0050.00916.91
7.2.110.0110.00516.51
7.2.100.0140.00616.47
7.2.90.0070.00816.45
7.2.80.0110.00816.48
7.2.70.0110.00416.52
7.2.60.0120.00716.54
7.2.50.0100.00916.58
7.2.40.0150.00516.59
7.2.30.0050.01116.41
7.2.20.0230.00916.56
7.2.10.0110.00816.51
7.2.00.0120.00716.50
7.1.330.0080.00816.01
7.1.320.0000.01715.88
7.1.310.0060.01015.91
7.1.300.0040.01115.58
7.1.290.0100.00715.88
7.1.280.0070.00315.97
7.1.270.0040.00415.91
7.1.260.0100.00316.09
7.1.250.0040.00915.80
7.1.230.0220.00913.94
7.1.220.0270.01014.07
7.1.210.0210.00714.00
7.1.200.0330.00014.09
7.1.190.0220.00313.98
7.1.180.0240.00913.80
7.1.170.0240.00613.86
7.1.160.0200.00714.15
7.1.150.0130.01313.90
7.1.140.0160.00713.96
7.1.130.0200.00313.97
7.1.120.0210.00613.84
7.1.110.0240.00013.93
7.1.100.0170.00713.93
7.1.90.0180.00613.61
7.1.80.0310.00413.82
7.1.70.0260.00413.79
7.1.60.0340.00931.95
7.1.50.0400.01031.79
7.1.40.0450.01031.66
7.1.30.0390.00731.86
7.1.20.0430.00931.84
7.1.10.0300.00013.85
7.1.00.0180.01413.99
5.6.380.0120.00014.37

preferences:
42.81 ms | 400 KiB | 5 Q