3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2013-01-03'); // jan 4 while ($date->format('Y') < 2015){ echo $date->format('Y-m-d') . PHP_EOL; $date->modify('+7 days'); }
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.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 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
2013-01-03 2013-01-10 2013-01-17 2013-01-24 2013-01-31 2013-02-07 2013-02-14 2013-02-21 2013-02-28 2013-03-07 2013-03-14 2013-03-21 2013-03-28 2013-04-04 2013-04-11 2013-04-18 2013-04-25 2013-05-02 2013-05-09 2013-05-16 2013-05-23 2013-05-30 2013-06-06 2013-06-13 2013-06-20 2013-06-27 2013-07-04 2013-07-11 2013-07-18 2013-07-25 2013-08-01 2013-08-08 2013-08-15 2013-08-22 2013-08-29 2013-09-05 2013-09-12 2013-09-19 2013-09-26 2013-10-03 2013-10-10 2013-10-17 2013-10-24 2013-10-31 2013-11-07 2013-11-14 2013-11-21 2013-11-28 2013-12-05 2013-12-12 2013-12-19 2013-12-26 2014-01-02 2014-01-09 2014-01-16 2014-01-23 2014-01-30 2014-02-06 2014-02-13 2014-02-20 2014-02-27 2014-03-06 2014-03-13 2014-03-20 2014-03-27 2014-04-03 2014-04-10 2014-04-17 2014-04-24 2014-05-01 2014-05-08 2014-05-15 2014-05-22 2014-05-29 2014-06-05 2014-06-12 2014-06-19 2014-06-26 2014-07-03 2014-07-10 2014-07-17 2014-07-24 2014-07-31 2014-08-07 2014-08-14 2014-08-21 2014-08-28 2014-09-04 2014-09-11 2014-09-18 2014-09-25 2014-10-02 2014-10-09 2014-10-16 2014-10-23 2014-10-30 2014-11-06 2014-11-13 2014-11-20 2014-11-27 2014-12-04 2014-12-11 2014-12-18 2014-12-25
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/bW13Z 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/bW13Z 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/bW13Z on line 3

preferences:
285.91 ms | 401 KiB | 369 Q