bug45866.phpt 798 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #45866 (decimal values fed to DateTime->modify() causes long execution times)
  3. --INI--
  4. date.timezone=UTC
  5. --FILE--
  6. <?php
  7. $date = new DateTime( '2009-07-29 16:44:23 Europe/London' );
  8. $date->modify( "+1.61538461538 day" );
  9. echo $date->format( 'r' ), "\n";
  10. $date = new DateTime( '2009-07-29 16:44:23 Europe/London' );
  11. $date->modify( "61538461538 day" );
  12. echo $date->format( 'r' ), "\n";
  13. $date = new DateTime( '2009-07-29 16:44:23 Europe/London' );
  14. $date->modify( "£61538461538 day" );
  15. echo $date->format( 'r' ), "\n";
  16. ?>
  17. --EXPECTF--
  18. Thu, 14 Aug 168488594 16:44:23 +0100
  19. Thu, 14 Aug 168488594 16:44:23 +0100
  20. Warning: DateTime::modify(): Failed to parse time string (£61538461538 day) at position 0 (%s): Unexpected character in %sbug45866.php on line 11
  21. Wed, 29 Jul 2009 16:44:23 +0100