3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php print_r(verifyDate('1.1.2011')); echo ':::'; print_r(getMonth(null)); echo ':::'; print_r(getQuarter(null)); echo ':::'; print_r(dtf(' ')); function getMonth($d) { return dtf($d,'n'); } function getQuarter($d) { return ceil( getMonth($d) / 3); } function verifyDate($date) { return DateTime::createFromFormat('d.m.Y', $date); } function dtf($date, $format = 'd.m.Y'){ if($date){ $date = new DateTime($date); return $date->format($format); } }
based on VkBNb
Output for 5.6.28, 7.0.20 - 7.2.0
DateTime Object ( [date] => 2011-01-01 13:53:47.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 7.0.6
DateTime Object ( [date] => 2011-01-01 19:49:28.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::03.05.2016
Output for 7.0.5
DateTime Object ( [date] => 2011-01-01 08:09:34.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::03.04.2016
Output for 7.0.4
DateTime Object ( [date] => 2011-01-01 20:03:33.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::10.03.2016
Output for 7.0.3
DateTime Object ( [date] => 2011-01-01 21:24:20.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::18.03.2016
Output for 7.0.2
DateTime Object ( [date] => 2011-01-01 03:38:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::23.03.2016
Output for 7.0.1
DateTime Object ( [date] => 2011-01-01 06:55:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::24.03.2016
Output for 7.0.0
DateTime Object ( [date] => 2011-01-01 08:50:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::27.03.2016
Output for 5.6.21
DateTime Object ( [date] => 2011-01-01 14:57:34.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::02.05.2016
Output for 5.6.20
DateTime Object ( [date] => 2011-01-01 07:10:40.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::10.04.2016
Output for 5.6.19
DateTime Object ( [date] => 2011-01-01 04:16:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::08.03.2016
Output for 5.6.18
DateTime Object ( [date] => 2011-01-01 13:06:13.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::15.03.2016
Output for 5.6.17
DateTime Object ( [date] => 2011-01-01 00:41:10.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::20.03.2016
Output for 5.6.16
DateTime Object ( [date] => 2011-01-01 09:39:13.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::28.03.2016
Output for 5.6.15
DateTime Object ( [date] => 2011-01-01 10:28:48.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::29.03.2016
Output for 5.6.14
DateTime Object ( [date] => 2011-01-01 12:18:52.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::02.04.2016
Output for 5.6.13
DateTime Object ( [date] => 2011-01-01 16:50:06.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::15.04.2016
Output for 5.6.12
DateTime Object ( [date] => 2011-01-01 07:16:50.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::20.04.2016
Output for 5.6.11
DateTime Object ( [date] => 2011-01-01 13:41:27.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::24.04.2016
Output for 5.6.10
DateTime Object ( [date] => 2011-01-01 15:45:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::25.04.2016
Output for 5.6.9
DateTime Object ( [date] => 2011-01-01 20:53:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::27.04.2016
Output for 5.6.8
DateTime Object ( [date] => 2011-01-01 05:42:49.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.04.2016
Output for 5.5.35
DateTime Object ( [date] => 2011-01-01 23:49:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::22.05.2016
Output for 5.5.34
DateTime Object ( [date] => 2011-01-01 09:22:03.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::11.04.2016
Output for 5.5.33
DateTime Object ( [date] => 2011-01-01 07:08:35.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::09.03.2016
Output for 5.5.32
DateTime Object ( [date] => 2011-01-01 16:57:15.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::17.03.2016
Output for 5.5.31
DateTime Object ( [date] => 2011-01-01 03:46:34.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::21.03.2016
Output for 5.5.30
DateTime Object ( [date] => 2011-01-01 12:21:38.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::01.04.2016
Output for 5.5.29
DateTime Object ( [date] => 2011-01-01 07:08:10.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::17.04.2016
Output for 5.5.28
DateTime Object ( [date] => 2011-01-01 10:32:35.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::21.04.2016
Output for 5.5.27
DateTime Object ( [date] => 2011-01-01 12:15:19.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::22.04.2016
Output for 5.5.26
DateTime Object ( [date] => 2011-01-01 18:25:57.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::26.04.2016
Output for 5.5.25
DateTime Object ( [date] => 2011-01-01 01:49:24.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::29.04.2016
Output for 5.5.24
DateTime Object ( [date] => 2011-01-01 08:00:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::24.05.2016
Output for 5.4.45
DateTime Object ( [date] => 2011-01-01 13:53:52.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.44
DateTime Object ( [date] => 2011-01-01 13:53:53.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.43
DateTime Object ( [date] => 2011-01-01 13:53:56.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.41 - 5.4.42
DateTime Object ( [date] => 2011-01-01 13:53:57.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.40
DateTime Object ( [date] => 2011-01-01 13:53:58.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.39
DateTime Object ( [date] => 2011-01-01 13:53:59.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.38
DateTime Object ( [date] => 2011-01-01 13:54:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.37
DateTime Object ( [date] => 2011-01-01 13:54:01.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.36
DateTime Object ( [date] => 2011-01-01 13:54:02.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.35
DateTime Object ( [date] => 2011-01-01 13:54:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.34
DateTime Object ( [date] => 2011-01-01 13:54:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.32
DateTime Object ( [date] => 2011-01-01 13:54:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.31
DateTime Object ( [date] => 2011-01-01 13:54:08.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.30
DateTime Object ( [date] => 2011-01-01 13:54:09.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.29
DateTime Object ( [date] => 2011-01-01 13:54:09 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.28
DateTime Object ( [date] => 2011-01-01 13:54:10 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.27
DateTime Object ( [date] => 2011-01-01 13:54:11 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.26
DateTime Object ( [date] => 2011-01-01 13:54:12 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.25
DateTime Object ( [date] => 2011-01-01 13:54:13 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.23 - 5.4.24
DateTime Object ( [date] => 2011-01-01 13:54:15 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.22
DateTime Object ( [date] => 2011-01-01 13:54:17 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.21
DateTime Object ( [date] => 2011-01-01 13:54:18 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.20
DateTime Object ( [date] => 2011-01-01 13:54:19 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.19
DateTime Object ( [date] => 2011-01-01 13:54:20 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.4.18
DateTime Object ( [date] => 2011-01-01 13:54:21 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.27, 5.4.17
DateTime Object ( [date] => 2011-01-01 13:54:22 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.25 - 5.3.26, 5.4.16
DateTime Object ( [date] => 2011-01-01 13:54:23 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.24, 5.4.14 - 5.4.15
DateTime Object ( [date] => 2011-01-01 13:54:24 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.23, 5.4.13
DateTime Object ( [date] => 2011-01-01 13:54:25 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.21 - 5.3.22, 5.4.11 - 5.4.12
DateTime Object ( [date] => 2011-01-01 13:54:26 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.20, 5.4.10
DateTime Object ( [date] => 2011-01-01 13:54:27 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.29
DateTime Object ( [date] => 2011-01-01 13:54:07 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015
Output for 5.3.28
DateTime Object ( [date] => 2011-01-01 13:54:16 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) ::::::0:::30.11.2015