3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function check($dateAdded,$now){ $secondsInPast = $now->getTimestamp() - $dateAdded->getTimestamp(); if($secondsInPast > 60*60*2){ echo $dateAdded->format('H:i:s'). " Old enough $secondsInPast\n"; } else { echo $dateAdded->format('H:i:s'). " Not Old Enough $secondsInPast\n"; } } $now = new Datetime('now'); echo "Now:" . $now->format('H:i:s')."\n\n"; check(new DateTime('- 13 seconds'),$now); check(new DateTime('- 13 minutes'),$now); check(new DateTime('- 100 minutes'),$now); check(new DateTime('- 125 minutes'),$now);
based on hggYR
Output for 5.6.28, 7.0.14 - 7.1.0
Now:18:49:57 18:49:44 Not Old Enough 13 18:36:57 Not Old Enough 780 17:09:57 Not Old Enough 6000 16:44:57 Old enough 7500
Output for 7.0.6
Now:02:49:12 02:48:59 Not Old Enough 13 02:36:12 Not Old Enough 780 01:09:12 Not Old Enough 6000 00:44:12 Old enough 7500
Output for 7.0.5
Now:16:04:45 16:04:32 Not Old Enough 13 15:51:45 Not Old Enough 780 14:24:45 Not Old Enough 6000 13:59:45 Old enough 7500
Output for 7.0.4
Now:01:38:55 01:38:42 Not Old Enough 13 01:25:55 Not Old Enough 780 23:58:55 Not Old Enough 6000 23:33:55 Old enough 7500
Output for 7.0.3
Now:01:49:52 01:49:39 Not Old Enough 13 01:36:52 Not Old Enough 780 00:09:52 Not Old Enough 6000 23:44:52 Old enough 7500
Output for 7.0.2
Now:12:23:59 12:23:46 Not Old Enough 13 12:10:59 Not Old Enough 780 10:43:59 Not Old Enough 6000 10:18:59 Old enough 7500
Output for 7.0.1
Now:12:37:02 12:36:49 Not Old Enough 13 12:24:02 Not Old Enough 780 10:57:02 Not Old Enough 6000 10:32:02 Old enough 7500
Output for 7.0.0
Now:15:03:29 15:03:16 Not Old Enough 13 14:50:29 Not Old Enough 780 13:23:29 Not Old Enough 6000 12:58:29 Old enough 7500
Output for hhvm-3.12.0
Now:02:38:30 02:38:17 Not Old Enough 13 02:25:30 Not Old Enough 780 00:58:30 Not Old Enough 6000 00:33:30 Old enough 7500
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
Now:21:51:01 21:50:48 Not Old Enough 13 21:38:01 Not Old Enough 780 20:11:01 Not Old Enough 6000 19:46:01 Old enough 7500
Output for 5.6.20
Now:11:16:46 11:16:33 Not Old Enough 13 11:03:46 Not Old Enough 780 09:36:46 Not Old Enough 6000 09:11:46 Old enough 7500
Output for 5.6.19
Now:23:55:11 23:54:58 Not Old Enough 13 23:42:11 Not Old Enough 780 22:15:11 Not Old Enough 6000 21:50:11 Old enough 7500
Output for 5.6.18
Now:12:16:42 12:16:29 Not Old Enough 13 12:03:42 Not Old Enough 780 10:36:42 Not Old Enough 6000 10:11:42 Old enough 7500
Output for 5.6.17
Now:06:17:57 06:17:44 Not Old Enough 13 06:04:57 Not Old Enough 780 04:37:57 Not Old Enough 6000 04:12:57 Old enough 7500
Output for 5.6.16
Now:16:47:44 16:47:31 Not Old Enough 13 16:34:44 Not Old Enough 780 15:07:44 Not Old Enough 6000 14:42:44 Old enough 7500
Output for 5.6.15
Now:17:41:22 17:41:09 Not Old Enough 13 17:28:22 Not Old Enough 780 16:01:22 Not Old Enough 6000 15:36:22 Old enough 7500
Output for 5.6.14
Now:20:18:26 20:18:13 Not Old Enough 13 20:05:26 Not Old Enough 780 18:38:26 Not Old Enough 6000 18:13:26 Old enough 7500
Output for 5.6.13
Now:00:07:44 00:07:31 Not Old Enough 13 23:54:44 Not Old Enough 780 22:27:44 Not Old Enough 6000 22:02:44 Old enough 7500
Output for 5.6.12
Now:13:17:37 13:17:24 Not Old Enough 13 13:04:37 Not Old Enough 780 11:37:37 Not Old Enough 6000 11:12:37 Old enough 7500
Output for 5.6.11
Now:20:34:07 20:33:54 Not Old Enough 13 20:21:07 Not Old Enough 780 18:54:07 Not Old Enough 6000 18:29:07 Old enough 7500
Output for 5.6.10
Now:22:13:32 22:13:19 Not Old Enough 13 22:00:32 Not Old Enough 780 20:33:32 Not Old Enough 6000 20:08:32 Old enough 7500
Output for 5.6.9
Now:03:24:08 03:23:55 Not Old Enough 13 03:11:08 Not Old Enough 780 01:44:08 Not Old Enough 6000 01:19:08 Old enough 7500
Output for 5.6.8
Now:10:59:21 10:59:08 Not Old Enough 13 10:46:21 Not Old Enough 780 09:19:21 Not Old Enough 6000 08:54:21 Old enough 7500
Output for 5.6.7
Now:22:04:44 22:04:31 Not Old Enough 13 21:51:44 Not Old Enough 780 20:24:44 Not Old Enough 6000 19:59:44 Old enough 7500
Output for 5.5.35
Now:01:14:47 01:14:34 Not Old Enough 13 01:01:47 Not Old Enough 780 23:34:47 Not Old Enough 6000 23:09:47 Old enough 7500
Output for 5.5.34
Now:17:13:21 17:13:08 Not Old Enough 13 17:00:21 Not Old Enough 780 15:33:21 Not Old Enough 6000 15:08:21 Old enough 7500
Output for 5.5.33
Now:12:29:25 12:29:12 Not Old Enough 13 12:16:25 Not Old Enough 780 10:49:25 Not Old Enough 6000 10:24:25 Old enough 7500
Output for 5.5.32
Now:18:11:33 18:11:20 Not Old Enough 13 17:58:33 Not Old Enough 780 16:31:33 Not Old Enough 6000 16:06:33 Old enough 7500
Output for 5.5.31
Now:09:10:31 09:10:18 Not Old Enough 13 08:57:31 Not Old Enough 780 07:30:31 Not Old Enough 6000 07:05:31 Old enough 7500
Output for 5.5.30
Now:19:42:29 19:42:16 Not Old Enough 13 19:29:29 Not Old Enough 780 18:02:29 Not Old Enough 6000 17:37:29 Old enough 7500
Output for 5.5.29
Now:14:15:02 14:14:49 Not Old Enough 13 14:02:02 Not Old Enough 780 12:35:02 Not Old Enough 6000 12:10:02 Old enough 7500
Output for 5.5.28
Now:16:34:48 16:34:35 Not Old Enough 13 16:21:48 Not Old Enough 780 14:54:48 Not Old Enough 6000 14:29:48 Old enough 7500
Output for 5.5.27
Now:19:04:35 19:04:22 Not Old Enough 13 18:51:35 Not Old Enough 780 17:24:35 Not Old Enough 6000 16:59:35 Old enough 7500
Output for 5.5.26
Now:00:33:38 00:33:25 Not Old Enough 13 00:20:38 Not Old Enough 780 22:53:38 Not Old Enough 6000 22:28:38 Old enough 7500
Output for 5.5.25
Now:06:40:47 06:40:34 Not Old Enough 13 06:27:47 Not Old Enough 780 05:00:47 Not Old Enough 6000 04:35:47 Old enough 7500
Output for 5.5.24
Now:14:09:35 14:09:22 Not Old Enough 13 13:56:35 Not Old Enough 780 12:29:35 Not Old Enough 6000 12:04:35 Old enough 7500
Output for 5.4.45
Now:15:04:09 15:03:56 Not Old Enough 13 14:51:09 Not Old Enough 780 13:24:09 Not Old Enough 6000 12:59:09 Old enough 7500
Output for 5.4.44
Now:15:04:03 15:03:50 Not Old Enough 13 14:51:03 Not Old Enough 780 13:24:03 Not Old Enough 6000 12:59:03 Old enough 7500
Output for 5.4.43
Now:15:03:58 15:03:45 Not Old Enough 13 14:50:58 Not Old Enough 780 13:23:58 Not Old Enough 6000 12:58:58 Old enough 7500
Output for 5.4.42
Now:09:31:07 09:30:54 Not Old Enough 13 09:18:07 Not Old Enough 780 07:51:07 Not Old Enough 6000 07:26:07 Old enough 7500
Output for 5.4.41
Now:09:31:05 09:30:52 Not Old Enough 13 09:18:05 Not Old Enough 780 07:51:05 Not Old Enough 6000 07:26:05 Old enough 7500
Output for 5.4.39 - 5.4.40
Now:09:31:00 09:30:47 Not Old Enough 13 09:18:00 Not Old Enough 780 07:51:00 Not Old Enough 6000 07:26:00 Old enough 7500
Output for 5.4.38
Now:09:30:58 09:30:45 Not Old Enough 13 09:17:58 Not Old Enough 780 07:50:58 Not Old Enough 6000 07:25:58 Old enough 7500
Output for 5.4.36 - 5.4.37
Now:09:30:56 09:30:43 Not Old Enough 13 09:17:56 Not Old Enough 780 07:50:56 Not Old Enough 6000 07:25:56 Old enough 7500
Output for 5.4.34 - 5.4.35
Now:09:30:55 09:30:42 Not Old Enough 13 09:17:55 Not Old Enough 780 07:50:55 Not Old Enough 6000 07:25:55 Old enough 7500
Output for 5.4.32
Now:18:50:01 18:49:48 Not Old Enough 13 18:37:01 Not Old Enough 780 17:10:01 Not Old Enough 6000 16:45:01 Old enough 7500
Output for 5.4.21 - 5.4.31
Now:18:50:02 18:49:49 Not Old Enough 13 18:37:02 Not Old Enough 780 17:10:02 Not Old Enough 6000 16:45:02 Old enough 7500
Output for 5.4.3 - 5.4.20
Now:18:50:03 18:49:50 Not Old Enough 13 18:37:03 Not Old Enough 780 17:10:03 Not Old Enough 6000 16:45:03 Old enough 7500
Output for 5.3.17 - 5.4.2
Now:18:50:04 18:49:51 Not Old Enough 13 18:37:04 Not Old Enough 780 17:10:04 Not Old Enough 6000 16:45:04 Old enough 7500
Output for 5.3.2 - 5.3.16
Now:18:50:05 18:49:52 Not Old Enough 13 18:37:05 Not Old Enough 780 17:10:05 Not Old Enough 6000 16:45:05 Old enough 7500
Output for 5.3.0 - 5.3.1
Now:18:50:06 18:49:53 Not Old Enough 13 18:37:06 Not Old Enough 780 17:10:06 Not Old Enough 6000 16:45:06 Old enough 7500
Output for 5.2.0 - 5.2.17
Now:18:50:06 Fatal error: Call to undefined method DateTime::getTimestamp() in /in/0uVaH on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'Datetime' not found in /in/0uVaH on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/0uVaH on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/0uVaH on line 10