3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $Start_Week = '201338'; $Optel_Week = 8; $start = new DateTime(); $start->setISODate(substr($Start_Week, 0, 4), substr($Start_Week, 4, 2)); echo $start->format('Y-m-d'), PHP_EOL; $start->add(new DateInterval(sprintf('P%dW', $Optel_Week))); echo $start->format('Y-m-d'), PHP_EOL;
Output for 5.3.0 - 7.1.0
2013-09-16 2013-11-11
Output for 5.2.0 - 5.2.17
2013-09-16 Fatal error: Call to undefined method DateTime::add() in /in/YYaXr on line 10
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/YYaXr on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/YYaXr on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/YYaXr on line 6