3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timesheets = [ ['diff_sec' => 1125, 'in_date_time' => '2021-03-04 19:45:05', 'out_date_time' => '2021-03-04 20:03:50'], ['diff_sec' => 17, 'in_date_time' => '2021-03-04 20:04:34', 'out_date_time' => '2021-03-04 20:04:51'], ['diff_sec' => 10500, 'in_date_time' => '2021-03-04 21:04:59', 'out_date_time' => '2021-03-04 23:59:59'], ['diff_sec' => 48, 'in_date_time' => '2021-03-04 22:08:07', 'out_date_time' => '2021-03-04 22:08:55'], ['diff_sec' => 16717, 'in_date_time' => '2021-03-05 14:46:32', 'out_date_time' => '2021-03-05 19:25:0'], ]; $diff = array_sum(array_column($timesheets, 'diff_sec')); $tmins = $diff / 60; $hours = floor($tmins / 60); $mins = $tmins%60; echo "$hours hours and $mins minutes";
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 473.45 to int loses precision in /in/Af7Cn on line 14 7 hours and 53 minutes

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.86 ms | 1382 KiB | 4 Q