|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-20 14:14 UTC] bjori@php.net
[2008-01-21 18:45 UTC] uw@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ In the latest snapshot of PHP (this behaviour is *not* in PHP 5.2.5) there appears to be a stricter check on what can be passed as the $new and $flag argument in mysql_connect. If the wrong type of argument is passed then two error messages are returned. The first says that the parameter should be long, the second is a warning that the there is the wrong parameter count in mysql_connect(). I believe that this second error message is a bug as a) it contradicts the previous error message and b) it does not say what the correct parameter count is as it usually does with this type of error message. Reproduce code: --------------- <?php $new = ''; $flag = 'string'; var_dump(mysql_connect('localhost', 'root', '', $new)); var_dump(mysql_connect('localhost', 'root', '', false, $flag)); ?> Expected result: ---------------- Warning: mysql_connect() expects parameter 4 to be long, string given in ...\mysql_connect.php on line 4 NULL Warning: mysql_connect() expects parameter 5 to be long, string given in ...\mysql_connect.php on line 5 NULL Actual result: -------------- Warning: mysql_connect() expects parameter 4 to be long, string given in C:\Josie\Workspace\Bugs\mysql\mysql_connect.php on line 4 Warning: Wrong parameter count for mysql_connect() in C:\Josie\Workspace\Bugs\mysql\mysql_connect.php on line 4 NULL Warning: mysql_connect() expects parameter 5 to be long, string given in C:\Josie\Workspace\Bugs\mysql\mysql_connect.php on line 5 Warning: Wrong parameter count for mysql_connect() in C:\Josie\Workspace\Bugs\mysql\mysql_connect.php on line 5 NULL