3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = json_decode(' [ { "log_id": 1310, "name": "ahmad", "fname": "Mohammad", "photo": "images/user_profile//1550473469.jpg", "title": "Doctor", "description": null, "empid": 3, "check_in": "11:56", "check_out": "17:25", "date": "2019-03-23", "time_long": "5:28", "leaveId": 5, "leaveLong": 16, "leaveFrom": "2019-03-15", "leaveTo": "2019-03-17" }, { "log_id": 1311, "name": "ahmad", "fname": "Mohammad", "photo": "images/user_profile//1550473469.jpg", "title": "Doctor", "description": null, "empid": 3, "check_in": "07:14", "check_out": "17:24", "date": "2019-03-24", "time_long": "10:9", "leaveId": 5, "leaveLong": 16, "leaveFrom": "2019-03-15", "leaveTo": "2019-03-17" },{ "log_id": 1312, "name": "ahmad", "fname": "Mohammad", "photo": "images/user_profile//1550473469.jpg", "title": "Doctor", "description": null, "empid": 3, "check_in": "06:58", "check_out": "17:21", "date": "2019-03-25", "time_long": "10:23", "leaveId": 5, "leaveLong": 16, "leaveFrom": "2019-03-15", "leaveTo": "2019-03-17" },{ "log_id": 1313, "name": "ahmad", "fname": "Mohammad", "photo": "images/user_profile//1550473469.jpg", "title": "Doctor", "description": null, "empid": 3, "check_in": "07:58", "check_out": "17:21", "date": "2019-03-26", "time_long": "9:23", "leaveId": 15, "leaveLong": 8.0, "leaveFrom": "2019-03-28", "leaveTo": "2019-03-29" }, { "log_id": 1314, "name": "ahmad", "fname": "Mohammad", "photo": "images/user_profile//1550473469.jpg", "title": "Doctor", "description": null, "empid": 3, "check_in": "07:58", "check_out": "17:21", "date": "2019-03-26", "time_long": "9:23", "leaveId": 5, "leaveLong": 8.0, "leaveFrom": "2019-03-28", "leaveTo": "2019-03-29" }, { "log_id": 1315, "name": "ahmad", "fname": "Mohammad", "photo": "images/user_profile//1550473469.jpg", "title": "Doctor", "description": null, "empid": 3, "check_in": "08:00", "check_out": "16:00", "date": "2019-03-27", "time_long": "8:00", "leaveId": 5, "leaveLong": 8.0, "leaveFrom": "2019-03-28", "leaveTo": "2019-03-29" },{ "log_id": 1316, "name": "Neda Mohammad", "fname": "Gada Mohammad", "photo": "images/user_profile//1550473758.jpg", "title": "Pharmacist", "description": null, "empid": 8, "check_in": "07:36", "check_out": "17:57", "date": "2019-03-25", "time_long": "10:20", "leaveId": null, "leaveLong": null, "leaveFrom": null, "leaveTo": null },{ "log_id": 1317, "name": "Neda Mohammad", "fname": "Gada Mohammad", "photo": "images/user_profile//1550473758.jpg", "title": "Pharmacist", "description": null, "empid": 8, "check_in": "08:00", "check_out": "16:00", "date": "2019-03-26", "time_long": "8:00", "leaveId": null, "leaveLong": null, "leaveFrom": null, "leaveTo": null },{ "log_id": 1318, "name": "Neda Mohammad", "fname": "Gada Mohammad", "photo": "images/user_profile//1550473758.jpg", "title": "Pharmacist", "description": null, "empid": 8, "check_in": "08:00", "check_out": "16:00", "date": "2019-03-27", "time_long": "8:00", "leaveId": null, "leaveLong": null, "leaveFrom": null, "leaveTo": null } ] ', true); $temp = []; foreach ($arr as $key => $value) { $temp[$value['empid']][$value['leaveId']][] = $value['leaveLong']; } $result = []; foreach ($temp as $key => $value) { foreach ($value as $key1 => $value1) { $result[$key][$key1] = max($value1); } } $result = array_map("array_sum", $result); 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.4.130.0160.00417.79
8.4.120.0130.00720.57
8.4.110.0160.00422.51
8.4.100.0130.00717.81
8.4.90.0120.00520.40
8.4.80.0130.00817.75
8.4.70.0110.00418.07
8.4.60.0070.00318.94
8.4.50.0050.00417.98
8.4.40.0050.00319.39
8.4.30.0160.00322.35
8.4.20.0130.00718.82
8.4.10.0060.00317.82
8.3.260.0120.00816.68
8.3.250.0090.00218.89
8.3.240.0130.00416.58
8.3.230.0110.00916.79
8.3.220.0080.00617.11
8.3.210.0140.00718.42
8.3.200.0100.00716.40
8.3.190.0080.00217.10
8.3.180.0090.00116.44
8.3.170.0190.00020.81
8.3.160.0150.00317.24
8.3.150.0090.00917.33
8.3.140.0040.00417.41
8.3.130.0090.00018.22
8.3.120.0060.00318.94
8.3.110.0140.00716.62
8.3.100.0030.00616.88
8.3.90.0000.00826.77
8.3.80.0060.00319.36
8.3.70.0120.00318.56
8.3.60.0170.00318.30
8.3.50.0070.00922.15
8.3.40.0100.00718.71
8.3.30.0040.01118.71
8.3.20.0060.00321.93
8.3.10.0040.00420.38
8.3.00.0050.00323.65
8.2.290.0140.00420.67
8.2.280.0110.00818.43
8.2.270.0040.01117.54
8.2.260.0090.00918.39
8.2.250.0060.00318.50
8.2.240.0060.00318.71
8.2.230.0040.00420.94
8.2.220.0100.01024.06
8.2.210.0140.00326.77
8.2.200.0090.00318.88
8.2.190.0070.01416.58
8.2.180.0090.00916.50
8.2.170.0060.00922.96
8.2.160.0110.01120.78
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0110.00726.16
8.2.120.0040.00419.31
8.2.110.0030.00722.20
8.2.100.0080.00417.97
8.2.90.0040.00417.80
8.2.80.0080.00019.16
8.2.70.0030.00617.63
8.2.60.0000.00918.16
8.2.50.0040.00418.07
8.2.40.0040.00818.16
8.2.30.0070.00018.27
8.2.20.0000.00818.23
8.2.10.0040.00419.46
8.2.00.0000.00719.26
8.1.330.0050.00522.04
8.1.320.0030.00615.97
8.1.310.0040.01416.97
8.1.300.0080.00019.74
8.1.290.0000.00930.84
8.1.280.0170.00025.92
8.1.270.0050.00322.05
8.1.260.0100.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00322.08
8.1.230.0030.00720.94
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0030.00617.35
8.1.180.0030.00618.10
8.1.170.0050.00318.50
8.1.160.0050.00218.84
8.1.150.0040.00418.77
8.1.140.0040.00418.86
8.1.130.0070.00020.09
8.1.120.0030.00517.39
8.1.110.0000.00817.36
8.1.100.0000.00717.39
8.1.90.0000.00717.46
8.1.80.0030.00517.51
8.1.70.0050.00217.50
8.1.60.0030.00517.57
8.1.50.0060.00317.60
8.1.40.0040.00417.48
8.1.30.0000.00817.60
8.1.20.0040.00417.53
8.1.10.0040.00417.46
8.1.00.0030.00517.50
8.0.300.0000.00820.34
8.0.290.0040.00416.88
8.0.280.0040.00418.39
8.0.270.0030.00317.30
8.0.260.0030.00318.36
8.0.250.0000.00817.00
8.0.240.0030.00316.98
8.0.230.0050.00216.92
8.0.220.0000.00816.94
8.0.210.0040.00416.82
8.0.200.0080.00016.88
8.0.190.0000.00816.95
8.0.180.0000.00716.96
8.0.170.0000.00916.97
8.0.160.0070.00416.89
8.0.150.0030.00316.78
8.0.140.0050.00216.93
8.0.130.0000.00513.35
8.0.120.0040.00416.88
8.0.110.0070.00016.97
8.0.100.0040.00417.04
8.0.90.0000.00816.76
8.0.80.0110.00816.86
8.0.70.0070.00016.71
8.0.60.0000.00816.95
8.0.50.0000.00816.91
8.0.30.0080.01017.00
8.0.20.0130.00617.02
8.0.10.0080.00017.10
8.0.00.0110.00816.79
7.4.330.0000.00515.55
7.4.320.0060.00016.65
7.4.300.0000.00616.63
7.4.290.0030.00416.63
7.4.280.0080.00016.54
7.4.270.0040.00416.54
7.4.260.0070.00016.49
7.4.250.0080.00016.53
7.4.240.0030.00316.66
7.4.230.0040.00416.45
7.4.220.0040.00416.71
7.4.210.0060.01216.61
7.4.200.0030.00316.62
7.4.140.0100.01017.86
7.4.130.0070.01016.56
7.4.120.0210.00016.57
7.4.110.0100.01016.65
7.4.100.0160.00616.64
7.4.90.0070.01016.44
7.4.80.0130.00719.39
7.4.70.0130.00616.32
7.4.60.0060.01016.42
7.4.50.0100.00716.65
7.4.40.0130.00316.70
7.4.00.0070.00714.71
7.3.330.0030.00313.35
7.3.320.0000.00513.07
7.3.310.0000.00716.50
7.3.300.0040.00416.41
7.3.290.0020.01316.34
7.3.280.0080.01116.36
7.3.260.0140.00516.50
7.3.240.0100.00716.49
7.3.230.0110.00616.32
7.3.210.0090.00616.37
7.3.200.0120.00916.36
7.3.190.0110.00616.57
7.3.180.0040.01216.42
7.3.170.0060.01016.39
7.3.160.0150.00616.62
7.3.60.0120.00914.78
7.3.50.0130.00014.93
7.3.40.0060.00614.73
7.3.30.0100.00714.78
7.3.20.0110.00716.32
7.3.10.0090.00316.54
7.3.00.0100.00616.49
7.2.330.0110.00816.75
7.2.320.0140.00416.72
7.2.310.0130.00716.68
7.2.300.0160.00616.71
7.2.290.0060.00916.52
7.2.190.0090.00615.13
7.2.180.0110.00414.89
7.2.170.0000.01315.09
7.2.160.0070.00415.21
7.2.150.0070.00616.82
7.2.140.0040.01416.85
7.2.130.0030.00916.72
7.2.120.0100.00416.81
7.2.110.0030.01016.65
7.2.100.0060.00616.63
7.2.90.0080.00416.79
7.2.80.0060.00616.95
7.2.70.0000.01816.95
7.2.60.0150.00916.94
7.2.50.0100.00516.94
7.2.40.0060.00916.91
7.2.30.0040.01117.00
7.2.20.0060.00916.82
7.2.10.0110.00416.66
7.2.00.0030.01616.86
7.1.300.0100.00315.70
7.1.290.0070.00715.64
7.1.280.0030.01015.85
7.1.270.0060.00615.63
7.1.260.0070.01015.91
7.1.250.0160.00315.81

preferences:
30.21 ms | 403 KiB | 5 Q