#27048 [Opn->Bgs]: Checkdate() broken
| From: | sniper@php.net | Date: | Tue, 27 Jan 2004 01:13:50 +0000 |
| Subject: | #27048 [Opn->Bgs]: Checkdate() broken | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53932@lists.php.net to get a copy of this message | ||
ID: 27048
Updated by: sniper@php.net
Reported By: as at web-dillingen dot de
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux
PHP Version: 4CVS
New Comment:
See bug #25530. You can only pass integers to this function.
See also http://www.php.net/checkdate
Previous Comments:
------------------------------------------------------------------------
[2004-01-26 10:26:27] as at web-dillingen dot de
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 this bug report at http://bugs.php.net/?id=27048&edit=1