- var_dump: documentation ( source)
<?php
$yearMonth = '2017-06';
$startDate = new \DateTime($yearMonth . '-01');
$endDate = clone $startDate;
$endDate->modify('last day of this month');
$startDate->modify('monday this week 00:00:00');
$endDate->modify('sunday this week 23:59:59');
var_dump($startDate);
var_dump($endDate);