3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function validaData($date, $format = 'Y-m-d H:i:s') { $v_date = date_create_from_format($format, $date); $v_date = date_format($v_date, $format); echo $v_date; return ($v_date && $v_date == $date); } var_dump(validaData('2014-2-28', 'Y-m-d')); # true
Output for 5.3.0 - 7.1.0
2014-02-28bool(false)
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.2.17
Fatal error: Call to undefined function date_create_from_format() in /in/u7Jkp on line 4
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/u7Jkp on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_create_from_format() in /in/u7Jkp on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_create_from_format() in /in/u7Jkp on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_create_from_format() in /in/u7Jkp on line 4