3v4l.org

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