3v4l.org

run code in 200+ php & hhvm versions
<?php $minutes = 41; $hours = 2; $add = 30; $new_minutes = ($minutes + $add) % 60; $new_hours = $hours + floor(($minutes + $add) / 60); echo "Previous: {$hours} hours, {$minutes} minutes.\n"; echo "Add {$add} minutes.\n"; echo "Current: {$new_hours} hours, {$new_minutes} minutes."; ?>
based on E0eMM
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.2.6
Previous: 2 hours, 41 minutes. Add 30 minutes. Current: 3 hours, 11 minutes.