3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime; for ($w = 52; $w <= 54; $w++) { $dt->setISODate(2013, $w); print_r($dt); echo $dt->format('Y W') . "\n\n"; }
Output for 7.3.1
DateTime Object ( [date] => 2013-12-23 13:03:24.032473 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.032473 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.032473 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.3.0
DateTime Object ( [date] => 2013-12-23 13:03:24.000104 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000104 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000104 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.13
DateTime Object ( [date] => 2013-12-23 13:03:24.000146 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000146 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000146 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.12
DateTime Object ( [date] => 2013-12-23 13:03:24.000158 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000158 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000158 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.11
DateTime Object ( [date] => 2013-12-23 13:03:24.000096 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000096 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000096 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.19, 7.2.10
DateTime Object ( [date] => 2013-12-23 13:03:24.000117 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000117 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000117 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.9
DateTime Object ( [date] => 2013-12-23 13:03:24.000141 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000141 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000141 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.8
DateTime Object ( [date] => 2013-12-23 13:03:24.000119 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000119 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000119 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.21, 7.2.7
DateTime Object ( [date] => 2013-12-23 13:03:24.000106 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000106 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000106 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.6
DateTime Object ( [date] => 2013-12-23 13:03:24.000184 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000184 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000184 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.5
DateTime Object ( [date] => 2013-12-23 13:03:24.000110 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000110 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000110 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.4
DateTime Object ( [date] => 2013-12-23 13:03:24.000192 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000192 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000192 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.3
DateTime Object ( [date] => 2013-12-23 13:03:24.000111 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000111 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000111 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.2
DateTime Object ( [date] => 2013-12-23 13:03:24.000098 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000098 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000098 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.1
DateTime Object ( [date] => 2013-12-23 13:03:24.000126 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000126 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000126 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.2.0
DateTime Object ( [date] => 2013-12-23 13:03:24.000105 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000105 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000105 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.25
DateTime Object ( [date] => 2013-12-23 13:03:24.000138 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000138 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000138 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.5, 7.1.24
DateTime Object ( [date] => 2013-12-23 13:03:24.000109 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000109 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000109 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.13, 7.1.23
DateTime Object ( [date] => 2013-12-23 13:03:24.000162 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000162 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000162 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.2, 7.1.22
DateTime Object ( [date] => 2013-12-23 13:03:24.000087 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000087 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000087 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.20
DateTime Object ( [date] => 2013-12-23 13:03:24.000103 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000103 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000103 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.18
DateTime Object ( [date] => 2013-12-23 13:03:24.000121 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000121 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000121 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.17
DateTime Object ( [date] => 2013-12-23 13:03:24.000113 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000113 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000113 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.16
DateTime Object ( [date] => 2013-12-23 13:03:24.000122 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000122 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000122 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.15
DateTime Object ( [date] => 2013-12-23 13:03:24.000160 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000160 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000160 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.14
DateTime Object ( [date] => 2013-12-23 13:03:24.000145 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000145 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000145 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.12
DateTime Object ( [date] => 2013-12-23 13:03:24.000118 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000118 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000118 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.11
DateTime Object ( [date] => 2013-12-23 13:03:24.000134 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000134 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000134 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.10
DateTime Object ( [date] => 2013-12-23 13:03:24.000100 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000100 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000100 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.1, 7.1.9
DateTime Object ( [date] => 2013-12-23 13:03:24.000084 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000084 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000084 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.8
DateTime Object ( [date] => 2013-12-23 13:03:24.000107 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000107 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000107 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.7
DateTime Object ( [date] => 2013-12-23 13:03:24.000085 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000085 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000085 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.6
DateTime Object ( [date] => 2013-12-23 13:03:24.000151 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000151 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000151 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.4
DateTime Object ( [date] => 2013-12-23 13:03:24.000090 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000090 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000090 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.0, 5.6.2 - 7.0.33, 7.1.3
DateTime Object ( [date] => 2013-12-23 13:03:24.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 7.1.0
DateTime Object ( [date] => 2013-12-23 13:03:24.028856 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24.028856 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24.028856 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 5.6.1
DateTime Object ( [date] => 2013-12-23 13:03:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
DateTime Object ( [date] => 2013-12-23 13:03:24 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 52 DateTime Object ( [date] => 2013-12-30 13:03:24 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2013 01 DateTime Object ( [date] => 2014-01-06 13:03:24 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 2014 02
Output for 5.2.0 - 5.2.17
DateTime Object ( ) 2013 52 DateTime Object ( ) 2013 01 DateTime Object ( ) 2014 02
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/56np5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/56np5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/56np5 on line 3