3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '2012-12-12')); var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '2012')); var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '0')); var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '2000-0-0'));
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2012-12-12 15:23:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1999-11-30 15:23:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.15.4
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2012-12-12 15:23:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } bool(false) bool(false) object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#5 (3) { ["date"]=> string(26) "1999-11-30 15:23:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } }