3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tomorrow = new DateTimeImmutable('tomorrow'); // Will be midnight in the am $dayAfter = $tomorrow->add(new DateInterval('P1D')); // Will also be midnight $timestamp = time(); $isTomorrow = ($timestamp > $tomorrow->getTimestamp() && $dayAfter->getTimestamp() > $timestamp); var_dump($isTomorrow); $timestamp = $timestamp + (60 * 60 * 24); $isTomorrow = ($timestamp > $tomorrow->getTimestamp() && $dayAfter->getTimestamp() > $timestamp); var_dump($isTomorrow); $timestamp = $timestamp + (60 * 60 * 24); $isTomorrow = ($timestamp > $tomorrow->getTimestamp() && $dayAfter->getTimestamp() > $timestamp); var_dump($isTomorrow);
Output for 7.1.25 - 7.1.27, 7.2.0 - 7.2.16, 7.3.0 - 7.3.3
bool(false) bool(true) bool(false)

preferences:
73.06 ms | 402 KiB | 29 Q