Notice: A non well formed numeric value encountered in. This in my case was caused by a date which I tried to minus it from a year which means both they were supposed to be numeric.
In the code below I just filtered and got the year only from the date
$mynewdob = new \DateTime("2019-01-11");
$finaldate = date_format($mynewdob, 'Y');
echo ($finaldate);