- var_dump: documentation ( source)
<?php
/**
* @param String $dateString
* @return DateTime
*/
function updateDate($dateString){
$suppliedDate = new \DateTime($dateString);
$currentYear = (int)(new \DateTime())->format('Y');
return (new \DateTime())->setDate($currentYear, (int)$suppliedDate->format('m'), (int)$suppliedDate->format('d'));
}
var_dump(updateDate('8th August 2011'));