3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dates = array( '23.5.14', '23.05.14', '23.05.2014', '5/23/14', '05/23/14', '05/23/2014',);foreach ($dates as $date) { echo $date . "\t\t=>\t"; try { $temp_date = new DateTime($date); echo $temp_date->format('Y-m-d'); } catch (Exception $e) { echo 'error'; } echo "\n";}
based on tA3mv
Output for 5.2.0 - 5.4.34, 5.6.28, 7.0.14 - 7.1.0
23.5.14 => 2014-10-31 23.05.14 => 2014-10-31 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.6
23.5.14 => 2016-05-03 23.05.14 => 2016-05-03 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.5
23.5.14 => 2016-04-02 23.05.14 => 2016-04-02 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.4
23.5.14 => 2016-03-10 23.05.14 => 2016-03-10 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.3
23.5.14 => 2016-03-18 23.05.14 => 2016-03-18 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.2
23.5.14 => 2016-03-21 23.05.14 => 2016-03-21 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.1
23.5.14 => 2016-03-23 23.05.14 => 2016-03-23 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 7.0.0
23.5.14 => 2016-03-26 23.05.14 => 2016-03-26 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for hhvm-3.12.0
23.5.14 => 2016-03-29 23.05.14 => 2016-03-29 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for hhvm-3.10.0
23.5.14 => 2016-03-30 23.05.14 => 2016-03-30 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.21
23.5.14 => 2016-05-02 23.05.14 => 2016-05-02 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.20
23.5.14 => 2016-04-09 23.05.14 => 2016-04-09 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.19
23.5.14 => 2016-03-07 23.05.14 => 2016-03-07 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.18
23.5.14 => 2016-03-14 23.05.14 => 2016-03-14 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.17
23.5.14 => 2016-03-19 23.05.14 => 2016-03-19 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.16
23.5.14 => 2016-03-27 23.05.14 => 2016-03-27 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.15
23.5.14 => 2016-03-28 23.05.14 => 2016-03-28 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.14
23.5.14 => 2016-04-01 23.05.14 => 2016-04-01 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.13
23.5.14 => 2016-04-15 23.05.14 => 2016-04-15 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.12
23.5.14 => 2016-04-19 23.05.14 => 2016-04-19 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.11
23.5.14 => 2016-04-22 23.05.14 => 2016-04-22 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.10
23.5.14 => 2016-04-25 23.05.14 => 2016-04-25 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.9
23.5.14 => 2016-04-27 23.05.14 => 2016-04-27 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.8
23.5.14 => 2016-04-29 23.05.14 => 2016-04-29 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.6.7
23.5.14 => 2016-05-25 23.05.14 => 2016-05-25 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.35
23.5.14 => 2016-05-22 23.05.14 => 2016-05-22 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.34
23.5.14 => 2016-04-10 23.05.14 => 2016-04-10 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.33
23.5.14 => 2016-03-08 23.05.14 => 2016-03-08 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.32
23.5.14 => 2016-03-16 23.05.14 => 2016-03-16 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.31
23.5.14 => 2016-03-20 23.05.14 => 2016-03-20 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.30
23.5.14 => 2016-03-31 23.05.14 => 2016-03-31 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.29
23.5.14 => 2016-04-16 23.05.14 => 2016-04-16 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.28
23.5.14 => 2016-04-20 23.05.14 => 2016-04-20 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.27
23.5.14 => 2016-04-21 23.05.14 => 2016-04-21 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.26
23.5.14 => 2016-04-26 23.05.14 => 2016-04-26 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.25
23.5.14 => 2016-04-28 23.05.14 => 2016-04-28 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.5.24
23.5.14 => 2016-05-23 23.05.14 => 2016-05-23 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.4.35 - 5.4.45
23.5.14 => 2015-09-07 23.05.14 => 2015-09-07 23.05.2014 => 2014-05-23 5/23/14 => 2014-05-23 05/23/14 => 2014-05-23 05/23/2014 => 2014-05-23
Output for 5.0.0 - 5.1.6
23.5.14 => Fatal error: Class 'DateTime' not found in /in/dsJIu on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/dsJIu on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/dsJIu on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/dsJIu on line 3
Process exited with code 255.