bug70245.phpt 350 B

12345678910111213
  1. --TEST--
  2. Bug #70245 (strtotime does not emit warning when 2nd parameter is object or string)
  3. --FILE--
  4. <?php
  5. $d = new DateTime('2011-01-15 00:00:00');
  6. try {
  7. var_dump(strtotime('-1 month', $d));
  8. } catch (TypeError $e) {
  9. echo $e->getMessage(), "\n";
  10. }
  11. ?>
  12. --EXPECT--
  13. strtotime(): Argument #2 ($baseTimestamp) must be of type ?int, DateTime given