bug60302-002.phpt 270 B

12345678910111213
  1. --TEST--
  2. Test for bug #60302: DateTimeImmutable::createFromFormat should new static(), not new self()
  3. --FILE--
  4. <?php
  5. class MyDateTime extends DateTimeImmutable { }
  6. $d = MyDateTime::createFromFormat('Y-m-d', '2011-01-01');
  7. echo get_class($d);
  8. ?>
  9. --EXPECT--
  10. MyDateTime