From: as at web-dillingen dot de
Operating system: Linux PHP 4.3.5-dev
PHP version: 5.0.0b3 (beta3)
PHP Bug Type: Date/time related
Bug description: Checkdate() broken
Description:
------------
Bug in PHP 4.3.5-dev
When I put a variable into checkdate($month,$day,$year)
I get an error message, when one variable is empty or not existing.
I haven't found that in other versions.
Reproduce code:
---------------
PHP 4.3.5-dev
$value is given by <input type=text' name=value'> It is up to the user.
There doesn't need to be a value.
$datum = explode(".",$value);
$day = $datum[0];
$month = $datum[1];
$year = $datum[2];
//****** $day,$month,$year may be empty ***********
$mydatum = new Date_Calc;
if
($mydatum->isValidDate($day,$month,$year)){
print "Hallo";
}
Expected result:
----------------
I want to get back "Hallo", when $datum is a Gegorian date.
This code worked fine in all other PHP-verions, but not in PHP 4.3.5-dev
Actual result:
--------------
PHP 4.3.5-dev
Warning: checkdate() expects parameter 2 to be long, string given in
/usr/local/lib/php/Date/Calc.php on line 70
Warning: checkdate() expects parameter 1 to be long, string given in
/usr/local/lib/php/Date/Calc.php on line 70
isValidDatefrom PEAR just uses checkdate. Not anything else , which is
relevant.
--
Edit bug report at http://bugs.php.net/?id=27048&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27048&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27048&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27048&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27048&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27048&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27048&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27048&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27048&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27048&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27048&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27048&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27048&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27048&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27048&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27048&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27048&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27048&r=float