3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Foo extends DateTime { const ATOM = 'Y-m-d'; } echo (new DateTime('2015-02-01'))->format(DateTime::ATOM), PHP_EOL; echo (new Foo('2015-02-01'))->format(Foo::ATOM);
based on YBc6i
Output for 5.5.0 - 7.4.6
2015-02-01T00:00:00+01:00 2015-02-01