3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dates = array( '20.5.14', '21.5.14', '22.5.14', '23.5.14', '24.5.14', '25.5.14', '26.5.14', '27.5.14', '28.5.14', '29.5.14', '30.5.14', '31.5.14', ); foreach ($dates as $date_in) { try { $temp_date = new DateTime($date_in); $date_out = $temp_date->format('Y-m-d'); } catch (Exception $e) { $date_out = 'error'; } printf('%1$ 12s => %2$s', $date_in, $date_out); echo "\n"; }
based on Uf4Me
Output for 5.3.0 - 5.4.34, 5.6.28, 7.0.14 - 7.1.0
20.5.14 => 2014-10-31 21.5.14 => 2014-10-31 22.5.14 => 2014-10-31 23.5.14 => 2014-10-31 24.5.14 => 2014-11-01 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 7.0.6
20.5.14 => 2016-05-03 21.5.14 => 2016-05-03 22.5.14 => 2016-05-03 23.5.14 => 2016-05-03 24.5.14 => 2016-05-04 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.14, 7.0.5
20.5.14 => 2016-04-02 21.5.14 => 2016-04-02 22.5.14 => 2016-04-02 23.5.14 => 2016-04-02 24.5.14 => 2016-04-03 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 7.0.4
20.5.14 => 2016-03-10 21.5.14 => 2016-03-10 22.5.14 => 2016-03-10 23.5.14 => 2016-03-10 24.5.14 => 2016-03-11 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 7.0.3
20.5.14 => 2016-03-18 21.5.14 => 2016-03-18 22.5.14 => 2016-03-18 23.5.14 => 2016-03-18 24.5.14 => 2016-03-19 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 7.0.2
20.5.14 => 2016-03-22 21.5.14 => 2016-03-22 22.5.14 => 2016-03-22 23.5.14 => 2016-03-22 24.5.14 => 2016-03-23 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 7.0.1
20.5.14 => 2016-03-23 21.5.14 => 2016-03-23 22.5.14 => 2016-03-23 23.5.14 => 2016-03-23 24.5.14 => 2016-03-24 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 7.0.0
20.5.14 => 2016-03-26 21.5.14 => 2016-03-26 22.5.14 => 2016-03-26 23.5.14 => 2016-03-26 24.5.14 => 2016-03-27 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.15, hhvm-3.12.0
20.5.14 => 2016-03-28 21.5.14 => 2016-03-28 22.5.14 => 2016-03-28 23.5.14 => 2016-03-28 24.5.14 => 2016-03-29 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
20.5.14 => 2016-05-02 21.5.14 => 2016-05-02 22.5.14 => 2016-05-02 23.5.14 => 2016-05-02 24.5.14 => 2016-05-03 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.20
20.5.14 => 2016-04-09 21.5.14 => 2016-04-09 22.5.14 => 2016-04-09 23.5.14 => 2016-04-09 24.5.14 => 2016-04-10 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.19
20.5.14 => 2016-03-07 21.5.14 => 2016-03-07 22.5.14 => 2016-03-07 23.5.14 => 2016-03-07 24.5.14 => 2016-03-08 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.18
20.5.14 => 2016-03-14 21.5.14 => 2016-03-14 22.5.14 => 2016-03-14 23.5.14 => 2016-03-14 24.5.14 => 2016-03-15 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.17
20.5.14 => 2016-03-19 21.5.14 => 2016-03-19 22.5.14 => 2016-03-19 23.5.14 => 2016-03-19 24.5.14 => 2016-03-20 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.16
20.5.14 => 2016-03-27 21.5.14 => 2016-03-27 22.5.14 => 2016-03-27 23.5.14 => 2016-03-27 24.5.14 => 2016-03-28 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.13
20.5.14 => 2016-04-15 21.5.14 => 2016-04-15 22.5.14 => 2016-04-15 23.5.14 => 2016-04-15 24.5.14 => 2016-04-16 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.12
20.5.14 => 2016-04-19 21.5.14 => 2016-04-19 22.5.14 => 2016-04-19 23.5.14 => 2016-04-19 24.5.14 => 2016-04-20 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.11
20.5.14 => 2016-04-23 21.5.14 => 2016-04-23 22.5.14 => 2016-04-23 23.5.14 => 2016-04-23 24.5.14 => 2016-04-24 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.10
20.5.14 => 2016-04-25 21.5.14 => 2016-04-25 22.5.14 => 2016-04-25 23.5.14 => 2016-04-25 24.5.14 => 2016-04-26 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.9
20.5.14 => 2016-04-27 21.5.14 => 2016-04-27 22.5.14 => 2016-04-27 23.5.14 => 2016-04-27 24.5.14 => 2016-04-28 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.8
20.5.14 => 2016-04-29 21.5.14 => 2016-04-29 22.5.14 => 2016-04-29 23.5.14 => 2016-04-29 24.5.14 => 2016-04-30 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.6.7
20.5.14 => 2016-05-25 21.5.14 => 2016-05-25 22.5.14 => 2016-05-25 23.5.14 => 2016-05-25 24.5.14 => 2016-05-26 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.35
20.5.14 => 2016-05-22 21.5.14 => 2016-05-22 22.5.14 => 2016-05-22 23.5.14 => 2016-05-22 24.5.14 => 2016-05-23 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.34
20.5.14 => 2016-04-10 21.5.14 => 2016-04-10 22.5.14 => 2016-04-10 23.5.14 => 2016-04-10 24.5.14 => 2016-04-11 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.33
20.5.14 => 2016-03-08 21.5.14 => 2016-03-08 22.5.14 => 2016-03-08 23.5.14 => 2016-03-08 24.5.14 => 2016-03-09 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.32
20.5.14 => 2016-03-17 21.5.14 => 2016-03-17 22.5.14 => 2016-03-17 23.5.14 => 2016-03-17 24.5.14 => 2016-03-18 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.31
20.5.14 => 2016-03-20 21.5.14 => 2016-03-20 22.5.14 => 2016-03-20 23.5.14 => 2016-03-20 24.5.14 => 2016-03-21 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.30
20.5.14 => 2016-04-01 21.5.14 => 2016-04-01 22.5.14 => 2016-04-01 23.5.14 => 2016-04-01 24.5.14 => 2016-04-02 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.29
20.5.14 => 2016-04-16 21.5.14 => 2016-04-16 22.5.14 => 2016-04-16 23.5.14 => 2016-04-16 24.5.14 => 2016-04-17 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.28
20.5.14 => 2016-04-20 21.5.14 => 2016-04-20 22.5.14 => 2016-04-20 23.5.14 => 2016-04-20 24.5.14 => 2016-04-21 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.27
20.5.14 => 2016-04-22 21.5.14 => 2016-04-22 22.5.14 => 2016-04-22 23.5.14 => 2016-04-22 24.5.14 => 2016-04-23 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.26
20.5.14 => 2016-04-26 21.5.14 => 2016-04-26 22.5.14 => 2016-04-26 23.5.14 => 2016-04-26 24.5.14 => 2016-04-27 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.25
20.5.14 => 2016-04-28 21.5.14 => 2016-04-28 22.5.14 => 2016-04-28 23.5.14 => 2016-04-28 24.5.14 => 2016-04-29 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.5.24
20.5.14 => 2016-05-23 21.5.14 => 2016-05-23 22.5.14 => 2016-05-23 23.5.14 => 2016-05-23 24.5.14 => 2016-05-24 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.4.35 - 5.4.45
20.5.14 => 2015-09-07 21.5.14 => 2015-09-07 22.5.14 => 2015-09-07 23.5.14 => 2015-09-07 24.5.14 => 2015-09-08 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.2.0 - 5.2.17
20.5.14 => 2014-10-31 21.5.14 => 2014-10-31 22.5.14 => 2014-10-31 23.5.14 => 2014-10-31 24.5.14 => 2014-05-24 25.5.14 => 2014-05-25 26.5.14 => 2014-05-26 27.5.14 => 2014-05-27 28.5.14 => 2014-05-28 29.5.14 => 2014-05-29 30.5.14 => 2014-05-30 31.5.14 => 2014-05-31
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/UkAUh on line 22
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/UkAUh on line 21
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/UkAUh on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/UkAUh on line 21
Process exited with code 255.