3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTimeBeforeStr = "2024/09/01 00:00:00"; $dateTimeBefore = new DateTimeImmutable($dateTimeStrBefore); $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
Warning: Undefined variable $dateTimeStrBefore in /in/OVrT2 on line 4 Deprecated: DateTimeImmutable::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/OVrT2 on line 4 string(19) "2024/09/01 00:00:00" object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2024-10-30 01:06:33.034974" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2024-10-30 01:06:32.034974" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(19) "2024-10-30 01:06:32"
Output for git.master
Warning: Undefined variable $dateTimeStrBefore in /in/OVrT2 on line 4 Deprecated: DateTimeImmutable::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/OVrT2 on line 4 string(19) "2024/09/01 00:00:00" object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2024-10-30 01:06:33.009813" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2024-10-30 01:06:32.009813" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(19) "2024-10-30 01:06:32"

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.88 ms | 408 KiB | 5 Q