#27097 [Opn]: checkdate asks for long doc says int

From: Date: Fri, 30 Jan 2004 16:13:06 +0000
Subject: #27097 [Opn]: checkdate asks for long doc says int
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969358597@lists.php.net to get a copy of this message
ID: 27097 Updated by: derick@php.net Reported By: trancer at trancer dot nl Status: Open Bug Type: Documentation problem Operating System: Windows XP PHP Version: et New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2004-01-30 11:03:51] et@php.net Note that "int" in php is a "signed long int"(32 bit), so int and long are equivalent. But i think you shouldn't have to know C to read error messages, so IMO the error message should change. I'll send a patch for that to the list. Additionally, checkdate() doesn't convert to int like other php functions do, but since it's a validating function, that strictness is desirable behaviour imo, but should be documented. I'll add a note to the manual. ------------------------------------------------------------------------ [2004-01-30 10:48:55] didou@php.net should the proto be number ? ------------------------------------------------------------------------ [2004-01-30 10:47:14] derick@php.net Nuno: And you need to learn to read ;-) He mentions that INT (from the manual) is not the same as the LONG (from the error message). ------------------------------------------------------------------------ [2004-01-30 10:15:19] nlopess@php.net The documentation is right. You are giving a string, while it expects an integer. You should learn more about variable types in PHP. ------------------------------------------------------------------------ [2004-01-30 08:00:35] trancer at trancer dot nl Description: ------------ Had the following warning: Warning: checkdate() expects parameter 1 to be long, string given in Documentation says: Description bool checkdate ( int month, int day, int year) int should be long here or long should be int, either of them. Might have to do with bug #25530, but still, the error issues a long while the demanded type is int. Reproduce code: --------------- <?php checkdate("", "", ""); ?> Expected result: ---------------- Warning: checkdate() expects parameter 1 to be int, string given in Actual result: -------------- Warning: checkdate() expects parameter 1 to be long, string given in ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27097&edit=1

« previous php.doc (#969358597) next »