3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i = 16; $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 VOjMX
Output for 5.6.28, 7.0.20 - 7.2.0
30-12-2015
Output for 7.0.6
23-08-2016
Output for 7.0.5
24-07-2016
Output for 7.0.4
30-06-2016
Output for 7.0.3
08-07-2016
Output for 7.0.2
13-07-2016
Output for 7.0.1
14-07-2016
Output for 7.0.0
17-07-2016
Output for 5.6.21
22-08-2016
Output for 5.6.20
31-07-2016
Output for 5.6.19
28-06-2016
Output for 5.6.18
05-07-2016
Output for 5.6.17
10-07-2016
Output for 5.6.16
18-07-2016
Output for 5.6.15
19-07-2016
Output for 5.6.14
23-07-2016
Output for 5.6.13
05-08-2016
Output for 5.6.12
10-08-2016
Output for 5.6.11
14-08-2016
Output for 5.6.10
15-08-2016
Output for 5.6.9
17-08-2016
Output for 5.6.8
20-08-2016
Output for 5.5.35
11-09-2016
Output for 5.5.34
01-08-2016
Output for 5.5.33
29-06-2016
Output for 5.5.32
07-07-2016
Output for 5.5.31
11-07-2016
Output for 5.5.30
22-07-2016
Output for 5.5.29
07-08-2016
Output for 5.5.28
11-08-2016
Output for 5.5.27
12-08-2016
Output for 5.5.26
16-08-2016
Output for 5.5.25
19-08-2016
Output for 5.5.24
13-09-2016
Output for 5.3.17 - 5.4.45
17-03-2016