$ PHP_VERSION=8.1 php -f test.php
string(10) "2024-01-02"
$ PHP_VERSION=8.2 php -f test.php
string(10) "2024-01-01"
Created
September 19, 2024 12:01
-
-
Save cs278/f90cc9cf5e718de14093983587a17c90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use League\Period\Duration; | |
require 'vendor/autoload.php'; | |
$dt = new \DateTimeImmutable('2024-01-01'); | |
var_dump($dt->add(Duration::create('+1 day'))->format('Y-m-d')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment