mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
8ac4d1190a
- Fixed tests: oo_002, bug46268 - Fixed bug #50930 (Wrong date by php_date.c patch with ancient gcc/glibc versions). - Make sure faulty strings passed to DateTime::modify() notify the user. - Revert fix for bug #50392 as it was fixed wrongly without a proper test case. - Fixed a bug with the 'r' formatting function as the default buffer size that was allocated only fit 4 digit years.
25 lines
798 B
PHP
25 lines
798 B
PHP
--TEST--
|
|
Bug #45866 (decimal values fed to DateTime->modify() causes long execution times)
|
|
--INI--
|
|
date.timezone=UTC
|
|
--FILE--
|
|
<?php
|
|
$date = new DateTime( '2009-07-29 16:44:23 Europe/London' );
|
|
$date->modify( "+1.61538461538 day" );
|
|
echo $date->format( 'r' ), "\n";
|
|
|
|
$date = new DateTime( '2009-07-29 16:44:23 Europe/London' );
|
|
$date->modify( "61538461538 day" );
|
|
echo $date->format( 'r' ), "\n";
|
|
|
|
$date = new DateTime( '2009-07-29 16:44:23 Europe/London' );
|
|
$date->modify( "£61538461538 day" );
|
|
echo $date->format( 'r' ), "\n";
|
|
?>
|
|
--EXPECTF--
|
|
Thu, 14 Aug 168488594 16:44:23 +0000
|
|
Thu, 14 Aug 168488594 16:44:23 +0000
|
|
|
|
Warning: DateTime::modify(): Failed to parse time string (£61538461538 day) at position 0 (%s): Unexpected character in %sbug45866.php on line 11
|
|
Wed, 29 Jul 2009 16:44:23 +0100
|