I have tried the following code to get the last day of week in the next month:

```
$paymentMonth = "2017-07";
$wee = new \DateTime($paymentMonth);
$firstDate = clone $wee->modify(('Sunday' == $wee->format('l')) ? 'Monday last week' : 'Monday this week'); //Monday of last week of previous month

$lastDate = clone $wee->modify('+1 month')->modify(('Sunday' == $wee->format('l')) ? 'Sunday last week' : 'Sunday this week');
/**^^^^
  * This works in most cases of months
  * but for july 2017, I want the last day of the first week of next month.
  */

echo $firstDate->format('Y-m-d'); //Gives 26-june
echo $lastDate->format('Y-m-d'); //Gives 30-july in this case i want the 31 of july...

```

What is the cleanest way to get the last day of first week of next month using [DateTime](http://php.net/manual/en/class.datetime.php)