3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace DrummondCentral\Bender\Command; class Command {} namespace Commands; use DrummondCentral\Bender\Command\Command; class HometimeCommand extends Command { public static function getCommand() { return 'hometime'; } public static function getDescription() { return 'Displays the number of hours and minutes until home time.'; } public function handle($message) { date_default_timezone_set('Europe/London'); $workend = strtotime('17:30'); $diff = $workend - time(); $hometime = gmdate("H:i:s", $diff); if (time() === $workend) { return 'It\'s home time! Rejoice!'; } return "Home time is in " . $hometime . "."; } } $command = new HometimeCommand(); var_dump($command->handle(''));
based on 8ianp
Output for 7.0.20 - 7.2.0
string(25) "Home time is in 21:11:11."
Output for 7.0.6
string(25) "Home time is in 23:36:37."
Output for 7.0.5
string(25) "Home time is in 11:12:22."
Output for 7.0.4
string(25) "Home time is in 23:23:01."
Output for 7.0.3
string(25) "Home time is in 22:10:42."
Output for 7.0.2
string(25) "Home time is in 16:03:19."
Output for 7.0.1
string(25) "Home time is in 12:29:21."
Output for 7.0.0
string(25) "Home time is in 10:33:39."
Output for 5.6.21
string(25) "Home time is in 04:27:41."
Output for 5.6.20
string(25) "Home time is in 12:12:53."
Output for 5.6.19
string(25) "Home time is in 15:12:02."
Output for 5.6.18
string(25) "Home time is in 06:25:29."
Output for 5.6.17
string(25) "Home time is in 18:49:02."
Output for 5.6.16
string(25) "Home time is in 09:46:17."
Output for 5.6.15
string(25) "Home time is in 08:55:44."
Output for 5.6.14
string(25) "Home time is in 07:05:50."
Output for 5.6.13
string(25) "Home time is in 02:37:50."
Output for 5.6.12
string(25) "Home time is in 12:09:48."
Output for 5.6.11
string(25) "Home time is in 05:46:29."
Output for 5.6.10
string(25) "Home time is in 03:44:18."
Output for 5.6.9
string(25) "Home time is in 22:34:24."
Output for 5.6.8
string(25) "Home time is in 13:41:25."
Output for 5.5.35
string(25) "Home time is in 20:27:29."
Output for 5.5.34
string(25) "Home time is in 10:01:24."
Output for 5.5.33
string(25) "Home time is in 12:25:31."
Output for 5.5.32
string(25) "Home time is in 02:33:23."
Output for 5.5.31
string(25) "Home time is in 15:45:44."
Output for 5.5.30
string(25) "Home time is in 07:01:55."
Output for 5.5.29
string(25) "Home time is in 12:16:28."
Output for 5.5.28
string(25) "Home time is in 08:55:28."
Output for 5.5.27
string(25) "Home time is in 07:09:59."
Output for 5.5.26
string(25) "Home time is in 01:01:15."
Output for 5.5.25
string(25) "Home time is in 18:04:54."
Output for 5.5.24
string(25) "Home time is in 11:36:17."
Output for 5.4.45
string(25) "Home time is in 21:11:08."
Output for 5.4.44
string(25) "Home time is in 21:11:07."
Output for 5.4.43
string(25) "Home time is in 21:11:06."
Output for 5.4.41 - 5.4.42
string(25) "Home time is in 21:11:05."
Output for 5.4.40
string(25) "Home time is in 21:11:04."
Output for 5.4.38 - 5.4.39
string(25) "Home time is in 21:11:03."
Output for 5.4.35 - 5.4.37
string(25) "Home time is in 21:11:02."
Output for 5.4.34
string(25) "Home time is in 21:11:01."
Output for 5.3.29, 5.4.29 - 5.4.32
string(25) "Home time is in 21:11:00."
Output for 5.4.26 - 5.4.28
string(25) "Home time is in 21:10:59."
Output for 5.4.23 - 5.4.25
string(25) "Home time is in 21:10:58."
Output for 5.3.28, 5.4.20 - 5.4.22
string(25) "Home time is in 21:10:57."
Output for 5.3.27, 5.4.17 - 5.4.19
string(25) "Home time is in 21:10:56."
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
string(25) "Home time is in 21:10:55."
Output for 5.3.20 - 5.3.23, 5.4.11 - 5.4.13
string(25) "Home time is in 21:10:54."
Output for 5.3.19, 5.4.9 - 5.4.10
string(25) "Home time is in 21:10:53."