3v4l.org

run code in 300+ PHP versions simultaneously
<?php $format = 'Y-m-d H:i:s'; // Using strtotime() function (Easiest) $time = strtotime('2016-09-03 14:55:24'); for ($x = 0; $x < 12; $x++) { $time = strtotime('+67 seconds', $time); echo date($format, $time) . "\n"; } echo "\n"; // Using DateTime objects, via the date_* functions $time = date_create('2016-09-03 14:55:24'); for ($x = 0; $x < 12; $x++) { date_add($time, date_interval_create_from_date_string('67 seconds')); echo date_format($time, $format) . "\n"; } echo "\n"; // Using DateTime objects, via Date* class methods $time = new DateTime('2016-09-03 14:55:24'); for ($x = 0; $x < 12; $x++) { $time->add(new DateInterval('PT67S')); echo $time->format($format) . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
2016-09-03 14:56:31 2016-09-03 14:57:38 2016-09-03 14:58:45 2016-09-03 14:59:52 2016-09-03 15:00:59 2016-09-03 15:02:06 2016-09-03 15:03:13 2016-09-03 15:04:20 2016-09-03 15:05:27 2016-09-03 15:06:34 2016-09-03 15:07:41 2016-09-03 15:08:48 2016-09-03 14:56:31 2016-09-03 14:57:38 2016-09-03 14:58:45 2016-09-03 14:59:52 2016-09-03 15:00:59 2016-09-03 15:02:06 2016-09-03 15:03:13 2016-09-03 15:04:20 2016-09-03 15:05:27 2016-09-03 15:06:34 2016-09-03 15:07:41 2016-09-03 15:08:48 2016-09-03 14:56:31 2016-09-03 14:57:38 2016-09-03 14:58:45 2016-09-03 14:59:52 2016-09-03 15:00:59 2016-09-03 15:02:06 2016-09-03 15:03:13 2016-09-03 15:04:20 2016-09-03 15:05:27 2016-09-03 15:06:34 2016-09-03 15:07:41 2016-09-03 15:08:48

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:
28.85 ms | 402 KiB | 8 Q