3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$writer = new XMLWriter(); echo var_dump(getdate(strtotime("2013-2"))); echo date("Y-m-t", strtotime("2013-2")); //echo date("Y-m-t", strtotime("first day of previous month") ) ;
based on CTsr3
Output for 5.0.0 - 5.0.5, 5.2.7 - 7.1.0
array(11) { ["seconds"]=> int(0) ["minutes"]=> int(0) ["hours"]=> int(0) ["mday"]=> int(1) ["wday"]=> int(5) ["mon"]=> int(2) ["year"]=> int(2013) ["yday"]=> int(31) ["weekday"]=> string(6) "Friday" ["month"]=> string(8) "February" [0]=> int(1359673200) } 2013-02-28
Output for 5.2.0 - 5.2.6
array(11) { ["seconds"]=> int(0) ["minutes"]=> int(0) ["hours"]=> int(0) ["mday"]=> int(3) ["wday"]=> int(0) ["mon"]=> int(3) ["year"]=> int(2013) ["yday"]=> int(61) ["weekday"]=> string(6) "Sunday" ["month"]=> string(5) "March" [0]=> int(1362265200) } 2013-03-31
Output for 5.1.1 - 5.1.6
array(11) { ["seconds"]=> int(0) ["minutes"]=> int(13) ["hours"]=> int(23) ["mday"]=> int(31) ["wday"]=> int(5) ["mon"]=> int(10) ["year"]=> int(2014) ["yday"]=> int(303) ["weekday"]=> string(6) "Friday" ["month"]=> string(7) "October" [0]=> int(1414793580) } 2014-10-31
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/3pKWF on line 5
Process exited with code 255.
Output for 4.3.0 - 4.4.9
array(11) { ["seconds"]=> int(59) ["minutes"]=> int(59) ["hours"]=> int(0) ["mday"]=> int(1) ["wday"]=> int(4) ["mon"]=> int(1) ["year"]=> int(1970) ["yday"]=> int(0) ["weekday"]=> string(8) "Thursday" ["month"]=> string(7) "January" [0]=> int(-1) } 1970-01-31