3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '2 months'; $n = strtotime('13 March 2014'); // curr = 5 // pstt = 7 // diff = 2 // trgt = 3 // curr - (pstt - curr) // 5 - (7 - 5) = 3 $t = $n - (strtotime($s, $n) - $n); echo date('M', $t);

preferences:
75.19 ms | 402 KiB | 5 Q