3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i = 15; $dt = new DateTime(); $interval = new DateInterval('P'.abs($i).'W'); ($i < 0) ? $dt->sub($interval) : $dt->add($interval); echo $dt->format('d-m-Y');
based on F3ii9
Output for 5.4.7 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
23-12-2015
Output for 7.0.6
16-08-2016
Output for 5.6.14, 7.0.5
16-07-2016
Output for 7.0.4
23-06-2016
Output for 7.0.3
01-07-2016
Output for 7.0.2
05-07-2016
Output for 7.0.1
06-07-2016
Output for 7.0.0
09-07-2016
Output for 5.6.21
15-08-2016
Output for 5.6.20
23-07-2016
Output for 5.6.19
20-06-2016
Output for 5.6.18
27-06-2016
Output for 5.6.17
02-07-2016
Output for 5.6.16
10-07-2016
Output for 5.6.15
11-07-2016
Output for 5.6.13
29-07-2016
Output for 5.6.12
02-08-2016
Output for 5.6.11
06-08-2016
Output for 5.6.10
08-08-2016
Output for 5.6.9
10-08-2016
Output for 5.6.8
12-08-2016
Output for 5.6.7
07-09-2016
Output for 5.5.35
04-09-2016
Output for 5.5.34
24-07-2016
Output for 5.5.33
21-06-2016
Output for 5.5.32
30-06-2016
Output for 5.5.31
03-07-2016
Output for 5.5.30
15-07-2016
Output for 5.5.29
30-07-2016
Output for 5.5.28
03-08-2016
Output for 5.5.27
05-08-2016
Output for 5.5.26
09-08-2016
Output for 5.5.25
11-08-2016
Output for 5.5.24
05-09-2016
Output for 5.4.2 - 5.4.6
09-02-2016
Output for 5.3.17 - 5.3.29
03-01-2016