3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $today = getdate(); $last2Months = getdate(strtotime("2 months ago", $today[0])); var_dump($last2Months);
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(11) { ["seconds"]=> int(35) ["minutes"]=> int(22) ["hours"]=> int(8) ["mday"]=> int(10) ["wday"]=> int(3) ["mon"]=> int(4) ["year"]=> int(2013) ["yday"]=> int(99) ["weekday"]=> string(9) "Wednesday" ["month"]=> string(5) "April" [0]=> int(1365574955) }
Output for 5.0.0 - 5.0.2
array(11) { ["seconds"]=> int(0) ["minutes"]=> int(0) ["hours"]=> int(0) ["mday"]=> int(10) ["wday"]=> int(3) ["mon"]=> int(4) ["year"]=> int(2013) ["yday"]=> int(99) ["weekday"]=> string(9) "Wednesday" ["month"]=> string(5) "April" [0]=> int(1365544800) }