3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = DateTime::createFromFormat('d/m/Y', '27-Jun-2017 15:13:46'); $b = DateTime::createFromFormat('d/m/Y', '26/10/1992'); var_dump($a); if ($a) { $a = DateTime::createFromFormat('d-M-Y H:i:s', '27-Jun-2017 15:13:46'); var_dump($a->format('jS M Y')); } var_dump($b); if ($b) { var_dump($b->format('jS M Y')); }
based on 4LmKA
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0alpha1
bool(false) object(DateTime)#1 (3) { ["date"]=> string(26) "1992-10-26 15:47:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(13) "26th Oct 1992"
Output for hhvm-3.15.4
bool(false) object(DateTime)#1 (3) { ["date"]=> string(26) "1992-10-26 15:47:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(13) "26th Oct 1992"