3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rcr(array $ids): array { $array = []; foreach ($ids as $id) { $array[$id] = rcr(getSubIds($id)); } return $array; } function getSubIds(int $id): array { switch ($id) { case 2: return [5, 108]; case 5: return [7]; case 7: return [46]; case 8: return [72]; default: return []; } } print_r(rcr([2, 14, 8]));

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.4.130.0030.00817.82
8.4.120.0120.00822.48
8.4.110.0060.00420.46
8.4.100.0170.00417.65
8.4.90.0060.00324.23
8.4.80.0040.00617.89
8.4.70.0080.00819.50
8.4.60.0090.01118.67
8.4.50.0100.01017.54
8.4.40.0130.00719.38
8.4.30.0070.00320.50
8.4.20.0070.01117.84
8.4.10.0070.01319.33
8.3.260.0140.00516.53
8.3.250.0080.00818.77
8.3.240.0130.00716.37
8.3.230.0130.01016.62
8.3.220.0090.00918.90
8.3.210.0080.00718.57
8.3.200.0070.00216.54
8.3.190.0100.00816.73
8.3.180.0120.00718.19
8.3.170.0070.01116.56
8.3.160.0000.00818.29
8.3.150.0090.00917.17
8.3.140.0170.00016.50
8.3.130.0060.00318.37
8.3.120.0030.00618.86
8.3.110.0050.00320.94
8.3.100.0060.00324.06
8.3.90.0040.00726.77
8.3.80.0090.00019.36
8.3.70.0110.00418.18
8.3.60.0090.00618.30
8.3.50.0110.00523.64
8.3.40.0100.00618.64
8.3.30.0120.00318.54
8.3.20.0040.00420.77
8.3.10.0070.00022.09
8.3.00.0050.00321.73
8.2.290.0110.00720.22
8.2.280.0090.00922.16
8.2.270.0130.00616.90
8.2.260.0110.00416.99
8.2.250.0000.00816.46
8.2.240.0030.00616.98
8.2.230.0080.00022.58
8.2.220.0060.00337.54
8.2.210.0050.00226.77
8.2.200.0000.00818.88
8.2.190.0100.00716.58
8.2.180.0140.00718.29
8.2.170.0120.00322.96
8.2.160.0070.00722.13
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00726.16
8.2.110.0090.00022.11
8.2.100.0070.00418.89
8.2.20.0080.00417.76
8.1.330.0100.00922.00
8.1.320.0100.00315.97
8.1.310.0060.01216.39
8.1.300.0040.01517.74
8.1.290.0030.00630.84
8.1.280.0110.00325.92
8.1.270.0080.00320.61
8.1.260.0080.00026.35
8.1.250.0090.00628.09
8.1.240.0090.00018.55
8.1.230.0000.00919.95
7.4.10.0150.00314.74
7.4.00.0030.01714.55
7.3.130.0120.00614.83
7.3.120.0160.00314.61
7.3.110.0030.01314.75
7.3.100.0080.01114.60
7.3.90.0100.00814.54
7.3.80.0000.01514.94
7.3.70.0080.00514.44
7.3.60.0100.00314.69
7.3.50.0100.01014.72
7.3.40.0120.00614.72
7.3.30.0120.01114.86
7.3.20.0000.01814.93
7.3.10.0060.01014.84
7.3.00.0170.00714.70
7.2.260.0160.00414.85
7.2.250.0000.02215.14
7.2.240.0060.01314.94
7.2.230.0120.00915.16
7.2.220.0050.01315.15
7.2.210.0030.01315.32
7.2.200.0090.00614.96
7.2.190.0070.00714.85
7.2.180.0060.01314.63
7.2.170.0060.00614.75
7.2.160.0120.00915.00
7.2.150.0090.01315.13
7.2.140.0090.00615.01
7.2.130.0000.01514.70
7.2.120.0080.00615.07
7.2.110.0070.01015.15
7.2.100.0030.01014.95
7.2.90.0100.00315.00
7.2.80.0000.01315.06
7.2.70.0090.00614.97
7.2.60.0030.01114.87
7.2.50.0120.00315.10
7.2.40.0100.00414.93
7.2.30.0030.01515.11
7.2.20.0090.00615.28
7.2.10.0100.00715.03
7.2.00.0070.01015.09

preferences:
29.18 ms | 403 KiB | 5 Q