3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Recurse1($xml) { $array = [(string)$xml['role']]; foreach ($xml->children() as $child) { $array = array_merge($array, Recurse1($child)); } 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.70.0150.00616.75
8.3.60.0130.00718.80
8.3.50.0070.01018.50
8.3.40.0060.00918.85
8.3.30.0150.00018.67
8.3.20.0030.00619.64
8.3.10.0050.00323.66
8.3.00.0040.00420.90
8.2.180.0090.00618.54
8.2.170.0110.00422.96
8.2.160.0090.00620.52
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0050.00318.14
8.2.120.0040.00426.35
8.2.110.0030.00721.30
8.2.100.0120.00017.97
8.2.90.0080.00018.34
8.2.80.0030.00517.97
8.2.70.0000.00818.29
8.2.60.0060.00318.28
8.2.50.0040.00418.10
8.2.40.0030.00519.59
8.2.30.0040.00419.53
8.2.20.0000.00818.33
8.2.10.0070.00018.28
8.2.00.0030.00717.89
8.1.280.0140.00325.92
8.1.270.0040.00419.18
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00024.01
8.1.230.0090.00321.15
8.1.220.0040.00418.04
8.1.210.0040.00419.16
8.1.200.0060.00317.35
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0000.00818.83
8.1.160.0030.00518.99
8.1.150.0050.00218.99
8.1.140.0040.00422.35
8.1.130.0040.00422.15
8.1.120.0000.00717.75
8.1.110.0060.00317.57
8.1.100.0030.00517.73
8.1.90.0030.00317.59
8.1.80.0030.00517.68
8.1.70.0000.00717.72
8.1.60.0040.00417.70
8.1.50.0000.00717.61
8.1.40.0030.00617.59
8.1.30.0030.00617.82
8.1.20.0090.00017.82
8.1.10.0020.00517.69
8.1.00.0040.00417.66
8.0.300.0050.00320.34
8.0.290.0030.00517.00
8.0.280.0070.00018.71
8.0.270.0080.00017.36
8.0.260.0000.00718.66
8.0.250.0000.00717.25
8.0.240.0080.00017.21
8.0.230.0070.00017.21
8.0.220.0050.00317.10
8.0.210.0000.00817.14
8.0.200.0000.00717.07
8.0.190.0040.00417.13
8.0.180.0060.00317.11
8.0.170.0000.00817.21
8.0.160.0000.00817.05
8.0.150.0000.00717.14
8.0.140.0000.00717.09
8.0.130.0000.00613.48
8.0.120.0050.00316.97
8.0.110.0000.00716.97
8.0.100.0000.00717.03
8.0.90.0050.00317.03
8.0.80.0070.00917.10
8.0.70.0040.00417.21
8.0.60.0040.00417.11
8.0.50.0000.00717.05
8.0.30.0150.00417.30
8.0.20.0100.00917.40
8.0.10.0040.00417.13
8.0.00.0090.01417.19
7.4.330.0000.00615.55
7.4.320.0000.00716.70
7.4.300.0020.00516.72
7.4.290.0000.00716.71
7.4.280.0050.00616.73
7.4.270.0030.00616.75
7.4.260.0040.00416.73
7.4.250.0000.00716.71
7.4.240.0080.00016.84
7.4.230.0050.00316.69
7.4.220.0070.00016.91
7.4.210.0040.01416.76
7.4.200.0070.00016.53
7.4.160.0090.01016.70
7.4.140.0100.01117.86
7.4.130.0090.00916.73
7.4.120.0090.01116.69
7.4.110.0090.01516.81
7.4.100.0080.00816.80
7.4.90.0100.00716.58
7.4.80.0090.01219.39
7.4.70.0060.01216.61
7.4.60.0030.01416.66
7.4.50.0040.01116.75
7.4.40.0030.01516.59
7.4.00.0070.01115.02
7.3.330.0000.00513.34
7.3.320.0000.00613.52
7.3.310.0000.00916.48
7.3.300.0000.00716.39
7.3.290.0030.00316.34
7.3.280.0070.01116.43
7.3.260.0100.00716.61
7.3.240.0100.00816.66
7.3.230.0110.00516.52
7.3.210.0090.00916.86
7.3.200.0100.00716.44
7.3.190.0060.01216.75
7.3.180.0200.00316.42
7.3.170.0050.00916.51
7.3.160.0070.01716.51
7.3.120.0100.00314.67
7.3.110.0060.00914.89
7.3.100.0070.00714.96
7.3.90.0030.01214.91
7.3.80.0060.00915.01
7.3.70.0000.01015.02
7.3.60.0060.00614.89
7.3.50.0100.00614.90
7.3.40.0110.00314.83
7.3.30.0110.00714.86
7.3.20.0090.00316.72
7.3.10.0070.01016.61
7.3.00.0090.00716.41
7.2.330.0090.00917.02
7.2.320.0100.01316.70
7.2.310.0140.00416.98
7.2.300.0150.00417.04
7.2.290.0030.01317.06
7.2.250.0110.00715.24
7.2.240.0030.01315.29
7.2.230.0000.01915.04
7.2.220.0090.00914.82
7.2.210.0070.01015.23
7.2.200.0030.00915.07
7.2.190.0000.02015.18
7.2.180.0080.00515.33
7.2.170.0060.01315.19
7.2.130.0050.00916.99
7.2.120.0100.00816.77
7.2.110.0300.00915.98
7.2.100.0250.00916.21
7.2.90.0310.00416.32
7.2.80.0250.00916.31
7.2.70.0280.00816.15
7.2.60.0400.00716.17
7.2.50.0310.00916.13
7.2.40.0310.00416.42
7.2.30.0240.01216.29
7.2.20.0340.00916.20
7.2.10.0310.00516.25
7.2.00.0250.00816.40
7.1.330.0000.01416.02
7.1.320.0060.00615.69
7.1.310.0030.01216.00
7.1.300.0090.00615.64
7.1.290.0140.00315.57
7.1.280.0070.00716.00
7.1.270.0040.01215.73
7.1.260.0030.01015.64
7.1.250.0100.00315.91
7.1.230.1050.00314.04
7.1.220.1670.01313.91
7.1.210.0710.01113.86
7.1.200.0760.00614.21
7.1.190.0560.01313.62
7.1.180.0760.01014.07
7.1.170.0920.00013.91
7.1.160.0780.01014.05
7.1.150.0710.00714.05
7.1.140.0570.00614.02
7.1.130.0820.01013.80
7.1.120.0720.00913.45
7.1.110.0780.00013.65
7.1.100.0650.01614.03
7.1.90.0660.00613.95
7.1.80.0690.01114.16
7.1.70.0510.00614.00
7.1.60.0510.01831.82
7.1.50.1060.00631.93
7.1.40.1210.00731.89
7.1.30.1090.01631.97
7.1.20.1410.00631.66
7.1.10.1090.00313.86
7.1.00.0650.00713.61
5.6.380.0130.00514.27

preferences:
34.58 ms | 401 KiB | 5 Q