Skip to content

Instantly share code, notes, and snippets.

@cs278
Created September 19, 2024 12:01
Show Gist options
  • Save cs278/f90cc9cf5e718de14093983587a17c90 to your computer and use it in GitHub Desktop.
Save cs278/f90cc9cf5e718de14093983587a17c90 to your computer and use it in GitHub Desktop.
$ 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"
<?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