3v4l.org

run code in 200+ PHP versions simultaneously
<?php $b = (new \DateTime((new \DateTimeImmutable())->modify("next Monday")->format("Y-m-d H:i:s"))); var_dump($a, $b, $c);
based on bjqZh
Output for 7.1.26 - 7.4.0
Notice: Undefined variable: a in /in/JpKfH on line 6 Notice: Undefined variable: c in /in/JpKfH on line 6 NULL object(DateTime)#1 (3) { ["date"]=> string(26) "2019-12-09 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } NULL