<?php
  $date 
= new DateTimeImmutable'2018-01-31 15:48:21' );
  echo 
$date->modify'first day of next month' )->format'Y-m-d' ), "\n";
?>
Output
2018-02-01

Explanation:
2018-01-31 15:48:21
2018-02-31 15:48:21 "next month" increases month number by 1
2018-02-01 15:48:21 "first day of" resets the day number to 1