3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dates = array( '23.5.14', ); foreach($dates as $date){ echo $date . "\t=>\t"; try{ $temp_date = new DateTime($date); echo $temp_date->format('Y-m-d'); } catch(Exception $e){ echo 'error'; } echo "\n"; }
based on XX17i
Output for 5.2.0 - 5.4.34, 5.6.28, 7.0.14 - 7.1.0
23.5.14 => 2014-10-31
Output for 7.0.6
23.5.14 => 2016-05-03
Output for 5.6.14, 7.0.5
23.5.14 => 2016-04-02
Output for 7.0.4
23.5.14 => 2016-03-10
Output for 7.0.3
23.5.14 => 2016-03-18
Output for 7.0.2
23.5.14 => 2016-03-22
Output for 7.0.1
23.5.14 => 2016-03-23
Output for 7.0.0
23.5.14 => 2016-03-26
Output for hhvm-3.12.0
23.5.14 => 2016-03-30
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
23.5.14 => 2016-05-02
Output for 5.6.20
23.5.14 => 2016-04-09
Output for 5.6.19
23.5.14 => 2016-03-07
Output for 5.6.18
23.5.14 => 2016-03-14
Output for 5.6.17
23.5.14 => 2016-03-19
Output for 5.6.16
23.5.14 => 2016-03-27
Output for 5.6.15
23.5.14 => 2016-03-28
Output for 5.6.13
23.5.14 => 2016-04-15
Output for 5.6.12
23.5.14 => 2016-04-19
Output for 5.6.11
23.5.14 => 2016-04-23
Output for 5.6.10
23.5.14 => 2016-04-25
Output for 5.6.9
23.5.14 => 2016-04-27
Output for 5.6.8
23.5.14 => 2016-04-29
Output for 5.6.7
23.5.14 => 2016-05-25
Output for 5.5.35
23.5.14 => 2016-05-22
Output for 5.5.34
23.5.14 => 2016-04-10
Output for 5.5.33
23.5.14 => 2016-03-08
Output for 5.5.32
23.5.14 => 2016-03-17
Output for 5.5.31
23.5.14 => 2016-03-20
Output for 5.5.30
23.5.14 => 2016-04-01
Output for 5.5.29
23.5.14 => 2016-04-16
Output for 5.5.28
23.5.14 => 2016-04-20
Output for 5.5.27
23.5.14 => 2016-04-22
Output for 5.5.26
23.5.14 => 2016-04-26
Output for 5.5.25
23.5.14 => 2016-04-28
Output for 5.5.24
23.5.14 => 2016-05-23
Output for 5.4.35 - 5.4.45
23.5.14 => 2015-09-07
Output for 5.0.0 - 5.1.6
23.5.14 => Fatal error: Class 'DateTime' not found in /in/tA3mv on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/tA3mv on line 9
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/tA3mv on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tA3mv on line 9
Process exited with code 255.