3v4l.org

run code in 300+ PHP versions simultaneously
<?php $seconds_in_hour = 60 * 60; $seconds_in_day = $seconds_in_hour * 24; $epoch = time(); $current_hour = $epoch % $seconds_in_day / $seconds_in_hour; echo $current_hour; if ($current_hour > 12) { $time_prefix = "pm"; $current_hour -= 12; } else { $time_prefix = "am"; } echo $current_hour; echo $time_prefix; ?>
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0
13.7697222222221.7697222222222pm

preferences:
141.29 ms | 404 KiB | 217 Q