3v4l.org

run code in 300+ PHP versions simultaneously
<?php $topics_percentage = [ ['id' => 8989, 'cat' => 'Category 1', 'completed' => 0], ['id' => 8919, 'cat' => 'Category 2', 'completed' => 1], ['id' => 8913, 'cat' => 'Category 2', 'completed' => 1], ['id' => 8947, 'cat' => 'Category 1', 'completed' => 1], ['id' => 8949, 'cat' => 'Category 3', 'completed' => 1], ]; $result = []; $lookup = ['noncompleted', 'completed']; foreach ($topics_percentage as ['cat' => $cat, 'completed' => $comp]) { $result[$cat][$lookup[$comp]] = ($result[$cat][$lookup[$comp]] ?? 0) + 1; } var_export($result);

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.130.0080.00016.58
8.3.120.0050.00320.70
8.3.110.0140.00020.94
8.3.100.0100.01024.06
8.3.90.0070.00726.77
8.3.80.0040.00417.97
8.3.70.0080.00818.43
8.3.60.0070.01418.36
8.3.50.0060.00916.61
8.3.40.0070.00723.64
8.3.30.0080.00820.13
8.3.20.0040.00424.18
8.3.10.0120.00623.60
8.3.00.0110.00718.97
8.2.250.0040.01116.50
8.2.240.0130.00718.77
8.2.230.0030.00722.58
8.2.220.0070.00337.54
8.2.210.0090.00626.77
8.2.200.0060.00316.75
8.2.190.0070.00716.58
8.2.180.0070.01416.63
8.2.170.0070.00719.05
8.2.160.0070.00722.96
8.2.150.0050.00324.18
8.2.140.0120.00620.38
8.2.130.0110.00720.40
8.2.120.0090.00919.05
8.2.110.0110.00719.09
8.2.100.0090.00918.97
8.2.90.0190.00018.97
8.2.80.0080.01119.18
8.2.70.0090.00918.72
8.2.60.0110.00418.75
8.2.50.0090.00618.72
8.2.40.0130.00718.87
8.2.30.0040.01118.70
8.2.20.0140.00718.89
8.2.10.0120.00618.78
8.2.00.0070.00718.70
8.1.300.0060.00317.83
8.1.290.0050.00530.84
8.1.280.0100.00325.92
8.1.270.0140.00322.06
8.1.260.0110.00722.07
8.1.250.0140.00322.06
8.1.240.0110.00718.66
8.1.230.0060.01318.34
8.1.220.0180.00018.86
8.1.210.0060.00318.53
8.1.200.0140.00418.93
8.1.190.0110.00718.71
8.1.180.0070.01018.42
8.1.170.0080.00018.62
8.1.160.0040.00418.51
8.1.150.0000.00818.48
8.1.140.0040.00418.49
8.1.130.0030.00618.81
8.1.120.0060.00318.54
8.1.110.0030.00518.60
8.1.100.0050.00318.54
8.1.90.0060.01018.67
8.1.80.0040.00418.55
8.1.70.0000.00818.63
8.1.60.0070.00718.68
8.1.50.0040.00418.73
8.1.40.0040.00418.63
8.1.30.0040.00418.81
8.1.20.0050.00318.64
8.1.10.0120.00318.79
8.1.00.0090.00618.56

preferences:
28.48 ms | 403 KiB | 5 Q