3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime(); $ts = (int)$now->format('U'); $midnight = $ts - $ts % 86400; $md = DateTime::createFromFormat('U', $midnight); var_dump($now, $ts, $midnight, $md); echo "\n\n"; $now_utc = (clone $now)->setTimezone(new DateTimeZone('UTC')); $new_midnight = (clone $now_utc)->modify('midnight'); $nmt = $new_midnight->format('U'); var_dump($now_utc, $new_midnight, $nmt);
Output for git.master
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-30 21:07:26.003885" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } int(1535656046) int(1535587200) object(DateTime)#2 (3) { ["date"]=> string(26) "2018-08-30 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-08-30 19:07:26.003885" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#4 (3) { ["date"]=> string(26) "2018-08-30 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } string(10) "1535587200"
Output for git.master_jit
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-30 21:07:26.003850" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } int(1535656046) int(1535587200) object(DateTime)#2 (3) { ["date"]=> string(26) "2018-08-30 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-08-30 19:07:26.003850" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#4 (3) { ["date"]=> string(26) "2018-08-30 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } string(10) "1535587200"
Output for rfc.property-hooks
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-30 21:07:26.003553" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } int(1535656046) int(1535587200) object(DateTime)#2 (3) { ["date"]=> string(26) "2018-08-30 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-08-30 19:07:26.003553" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#4 (3) { ["date"]=> string(26) "2018-08-30 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } string(10) "1535587200"

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