PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php public function setDate($year, $month, $day){ if (!is_numeric($year) || !is_numeric($month) || !is_numeric($day)) { throw new Exception('setDate() expects three numbers separated by commas in the order: year, month, day.'); } if (!checkdate($month, $day, $year)) { throw new Exception('Non-existent date.'); } parent::setDate($year, $month, $day); $this->_year = (int) $year; $this->_month = (int) $month; $this->_day = (int) $day; }
Show:  
Copy Clear