Edit report at https://bugs.php.net/bug.php?id=27097&edit=1
ID: 27097
Comment by: chrisdavies at hotmail dot com
Reported by: trancer at trancer dot nl
Summary: checkdate asks for long doc says int
Status: Wont fix
Type: Documentation Problem
Package: Documentation problem
Operating System: Windows XP
PHP Version: 4.3.4
Block user comment: N
Private report: N
New Comment:
I'm checking for the format of a date using :
if (checkdate ($month,$year,$day))
if the format is ok, then it's fine, if the format is wrong, checkdate dies with nasty errors,
anyway around this please?
Warning: checkdate() expects parameter 3 to be long, string given in
C:\Inetpub\wwwroot\dateSearch.php on line 40
should I not be using checkdate() for validation purposes? if not, wtf is the point of checkdate()?
Previous Comments:
------------------------------------------------------------------------
[2004-04-15 12:48:12] nlopess@php.net
Since we didn't arrive to any conclusion, I'm closing this bug.
------------------------------------------------------------------------
[2004-02-02 11:04:22] nlopess@php.net
What should we do then?
Maybe its better to add a note to http://php.net/manual/en/language.types.php
explaining that long is similar to an integer.
Ideas?
------------------------------------------------------------------------
[2004-01-30 11:14:57] et@php.net
Derick: Then why does zend_zval_type_name return "integer"?
------------------------------------------------------------------------
[2004-01-30 11:13:31] et@php.net
When i think more about it, it doesn't really make sense for checkdate to accept
"1e1" (which is "numeric" but not an integer) but not "1d1", so it is
either too strict or not strict enough. Any thoughts?
------------------------------------------------------------------------
[2004-01-30 11:13:05] derick@php.net
No, the error message is correct. We use a long, internal type is long, parse_parameters uses the
"l" as type specifier... the docs needs fixing.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=27097--
Edit this bug report at https://bugs.php.net/bug.php?id=27097&edit=1