3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attendances = json_decode('[ { "id": 4, "student_id": "18", "admission_no": "S18/2023", "class_id": "1", "session": "2022/2023", "marked": "present", "marked_date": "2023-05-15", "created_at": "2023-05-15 09:22:28" }, { "id": 2, "student_id": "18", "admission_no": "S18/2023", "class_id": "1", "session": "2022/2023", "marked": "absent", "marked_date": "2023-05-12", "created_at": "2023-05-12 14:06:55" } ]', true); foreach($attendances as $attendance) { $result[(int)explode('-', $attendance['marked_date'])[2]] = $attendance; } print_r($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.5.30.0100.00719.61
8.5.20.0100.00920.36
8.5.10.0100.00719.57
8.5.00.0140.00623.14
8.4.180.0130.00822.08
8.4.170.0140.00723.82
8.4.160.0160.00723.97
8.4.150.0080.00416.71
8.4.140.0130.01017.40
8.4.130.0090.00717.58
8.4.120.0120.00820.71
8.4.110.0050.00322.41
8.4.100.0090.01217.70
8.4.90.0100.01218.81
8.4.80.0100.01019.46
8.4.70.0120.00717.82
8.4.60.0100.01019.04
8.4.50.0140.00618.55
8.4.40.0140.00719.31
8.4.30.0060.01320.66
8.4.20.0130.00619.41
8.4.10.0030.00523.67
8.3.300.0100.01120.98
8.3.290.0110.01218.57
8.3.280.0120.00818.40
8.3.270.0110.00916.66
8.3.260.0110.00916.73
8.3.250.0110.00818.78
8.3.240.0100.01016.53
8.3.230.0080.01116.67
8.3.220.0020.00517.18
8.3.210.0060.00216.38
8.3.200.0060.00316.65
8.3.190.0110.00819.04
8.3.180.0110.00716.66
8.3.170.0090.00918.72
8.3.160.0060.01316.72
8.3.150.0100.01019.21
8.3.140.0040.00418.84
8.3.130.0050.00318.55
8.3.120.0000.01018.93
8.3.110.0080.00316.61
8.3.100.0090.00016.60
8.3.90.0030.00626.77
8.3.80.0040.00817.97
8.3.70.0140.00016.75
8.3.60.0170.00318.43
8.3.50.0120.00318.28
8.3.40.0070.01322.12
8.3.30.0140.00320.22
8.3.20.0000.00724.18
8.3.10.0060.00324.66
8.3.00.0050.00326.16
8.2.300.0150.00718.21
8.2.290.0100.00820.33
8.2.280.0120.00718.50
8.2.270.0150.00417.19
8.2.260.0110.00718.16
8.2.250.0040.00417.48
8.2.240.0030.00617.53
8.2.230.0060.01320.94
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0000.00916.50
8.2.190.0090.00916.58
8.2.180.0070.01018.42
8.2.170.0060.00919.09
8.2.160.0110.00422.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0110.00026.16
8.2.120.0080.00019.66
8.2.110.0090.00022.10
8.2.100.0000.01217.84
8.2.90.0000.00817.84
8.2.80.0040.00819.41
8.2.70.0190.00817.50
8.2.60.0240.00017.38
8.2.50.0200.00417.25
8.2.40.0190.00317.73
8.2.30.0160.00617.50
8.2.20.0050.01717.50
8.2.10.0160.00617.25
8.2.00.0110.01117.25
8.1.340.0140.00617.54
8.1.330.0120.00723.68
8.1.320.0100.00818.33
8.1.310.0130.00618.71
8.1.300.0030.00620.27
8.1.290.0090.00030.84
8.1.280.0160.00625.92
8.1.270.0080.00024.66
8.1.260.0000.00726.35
8.1.250.0030.00528.09
8.1.240.0080.00022.20
8.1.230.0040.00720.96
8.1.220.0060.00317.88
8.1.210.0040.00418.77
8.1.200.0000.01317.38
8.1.190.0120.00917.00
8.1.180.0240.00017.23
8.1.170.0170.00317.00
8.1.160.0120.00917.13
8.1.150.0120.00916.99
8.1.140.0190.00317.13
8.1.130.0140.00817.25
8.1.120.0220.00017.25
8.1.110.0080.01217.35
8.1.100.0140.00817.50
8.1.90.0170.00317.13
8.1.80.0120.01117.13
8.1.70.0210.00017.25
8.1.60.0130.00917.13
8.1.50.0200.00317.13
8.1.40.0160.00517.25
8.1.30.0160.00717.50
8.1.20.0150.00717.50
8.1.10.0140.00817.09
8.1.00.0190.00417.25
8.0.300.0000.00720.09
8.0.290.0150.00516.50
8.0.280.0160.00316.50
8.0.270.0170.00516.50
8.0.260.0170.00316.63
8.0.250.0190.00016.60
8.0.240.0190.00016.50
8.0.230.0130.00516.75
8.0.220.0160.00216.50
8.0.210.0150.00316.50
8.0.200.0150.00316.50
8.0.190.0120.00916.61
8.0.180.0120.00616.63
8.0.170.0170.00216.63
8.0.160.0160.00416.50
8.0.150.0080.01116.50
8.0.140.0200.00016.63
8.0.130.0130.00616.50
8.0.120.0060.01316.50
8.0.110.0140.00616.75
8.0.100.0200.00216.50
8.0.90.0150.00516.61
8.0.80.0120.00716.50
8.0.70.0070.01116.63
8.0.60.0130.00416.50
8.0.50.0110.00616.50
8.0.30.0070.01116.50
8.0.20.0130.00416.75
8.0.10.0150.00316.63

preferences:
55.46 ms | 1213 KiB | 5 Q