php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2292 CHECKDATE function: a little problem.
Submitted: 1999-09-14 05:05 UTC Modified: 1999-09-15 05:22 UTC
From: mvca at yahoo dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: Linux 2.0.35 (Slackware 3.5) and
Private report: No CVE-ID: None
 [1999-09-14 05:05 UTC] mvca at yahoo dot com
Hi,
excuse for my english.

The problem is little.
The function CHECKDATE want 3 INT parameters (int checkdate(int month, int day, int year)).
I use PHP Apache module and PHP interpreter with a PostgreSQL interface.
If I use a day value equal 08 or 09 the function have problem.

The examples:
------------------------------------------
<?php
if (checkdate(02,09,1999))
   echo "VALID";
else
   echo "NOT VALID";
?>
-------------------------------------------
The result is NOT VALID!

If I use the quotation mark the result is right: 
-------------------------------------------
<?php
if (checkdate(02,"09",1999))
   echo "VALID";
else
   echo "NOT VALID";
?>
--------------------------------------------
The result is VALID.

If I remove the 0 before the 8 or 9 the result is right : 
-------------------------------------------
<?php
if (checkdate(02,9,1999))
   echo "VALID";
else
   echo "NOT VALID";
?>
--------------------------------------------
The result is VALID.

I tried this examples on PHP v.3.0.6 and PHP v.3.0.12 with the same result.

Thank for your work.

Yours sincerely.

Angelo CONFLITTI.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-15 05:21 UTC] riffraff at cvs dot php dot net
09 is an invalid number, since the zero in the beginning means
that the rest is an octal number (base 8). Since "9" is
invalid number in octal, it results in numeric value 0.
2/0/1999 is surely an invalid date.
 [1999-09-15 05:22 UTC] riffraff at cvs dot php dot net
oops. sorry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 07:01:32 2024 UTC