3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime; for ($w = 1; $w <= 52; $w++) { $dt->setISODate(2013, $w); echo $dt->format('Y-m-d W') . "\n\n"; }
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2012-12-31 01 2013-01-07 02 2013-01-14 03 2013-01-21 04 2013-01-28 05 2013-02-04 06 2013-02-11 07 2013-02-18 08 2013-02-25 09 2013-03-04 10 2013-03-11 11 2013-03-18 12 2013-03-25 13 2013-04-01 14 2013-04-08 15 2013-04-15 16 2013-04-22 17 2013-04-29 18 2013-05-06 19 2013-05-13 20 2013-05-20 21 2013-05-27 22 2013-06-03 23 2013-06-10 24 2013-06-17 25 2013-06-24 26 2013-07-01 27 2013-07-08 28 2013-07-15 29 2013-07-22 30 2013-07-29 31 2013-08-05 32 2013-08-12 33 2013-08-19 34 2013-08-26 35 2013-09-02 36 2013-09-09 37 2013-09-16 38 2013-09-23 39 2013-09-30 40 2013-10-07 41 2013-10-14 42 2013-10-21 43 2013-10-28 44 2013-11-04 45 2013-11-11 46 2013-11-18 47 2013-11-25 48 2013-12-02 49 2013-12-09 50 2013-12-16 51 2013-12-23 52
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/2othd 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/2othd 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/2othd on line 3