3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = new DateTimeImmutable(); var_dump($time); var_dump($time->modify('+1 day'));
Output for 7.1.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-07-08 13:23:24.003973" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2014-07-09 13:23:24.003973" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.14 - 7.0.14
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-07-08 13:23:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2014-07-09 13:23:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.0 - 5.5.13
object(DateTimeImmutable)#1 (3) { ["date"]=> string(19) "2014-07-08 13:23:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(19) "2014-07-09 13:23:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/AZe6A on line 2
Process exited with code 255.