3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startDate = new DateTime('@' . mktime(0, 0, 0, date("m"), date("d") - 7, date("Y"))); $optionalStartDate = '2018-01-01 00:00:00'; print_r(strtotime($optionalStartDate)); print_r($startDate);
based on SbsaS
Output for 5.6.38 - 7.3.0rc3
1514761200DateTime Object ( [date] => 2018-10-22 22:00:00.000000 [timezone_type] => 1 [timezone] => +00:00 )