3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = sprintf('%04d-%02d', 2016, 02); $begin_date = $date . '-01'; $end_date = $date . '-' . date('t', strtotime($date . '-05')); var_dump($begin_date); var_dump($end_date);
Output for 5.6.0 - 7.3.0beta1
string(10) "2016-02-01" string(10) "2016-02-29"