3v4l.org

run code in 300+ PHP versions simultaneously
<?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.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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.0.5, 5.1.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.3.11, 4.4.0 - 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

preferences:
300.43 ms | 401 KiB | 457 Q