3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTimeBeforeStr = "2024/09/01 00:00:00"; $dateTimeBefore = new DateTimeImmutable($dateTimeBeforeStr); $dateTimeAfter = $dateTimeBefore->modify("-1 second"); $dateTimeAfterStr = $dateTimeAfter->format('Y-m-d H:i:s'); var_dump($dateTimeBeforeStr); var_dump($dateTimeBefore); var_dump($dateTimeAfter); var_dump($dateTimeAfterStr);
Output for git.master_jit, git.master
string(19) "2024/09/01 00:00:00" object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2024-09-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2024-08-31 23:59:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(19) "2024-08-31 23:59:59"

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:
25.3 ms | 406 KiB | 5 Q