title: PHP DateTime accepting invalid date
body: <p>I'm having trouble using the PHP <code>DateTime</code> class, and more specifically the <code>DateTime::createFromFormat()</code>.</p>
  
  <p>I get a date from a string, then try to instanciate a DateTime object, using <code>DateTime::createFromFormat()</code>. But, when I give this function a date that cannot exist, it is still working, returning me a valid <code>DateTime</code> object, with a valid date, <strong>which isn't the date I gave it</strong>.</p>
  
  <h2>Code example :</h2>
  
  <pre><code>$badDate = '2010-13-03';
  $date = DateTime::createFromFormat('Y-m-d', $badDate);
  
  var_dump($date);
  
  /*
  object(DateTime)#284 (3) {
  ["date"]=&gt;
  string(19) "2011-01-03 10:01:20"
  ["timezone_type"]=&gt;
  int(3)
  ["timezone"]=&gt;
  string(13) "Europe/Berlin"
  }
  */
  </code></pre>
  
  <p>Any ideas? I really need a way to check date validity.</p>
  
  <p>Thank you.</p>
  
  <h2>Edit:</h2>
  
  <p>I just found why, see my answer.</p>