From: josmessa at uk dot ibm dot com Operating system: Windows XP PHP version: 5.2CVS-2008-01-17 (snap) PHP Bug Type: MySQL related Bug description: Two error messages returned for $new and $flag argument in mysql_connect()
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 -- Edit bug report at http://bugs.php.net/?id=43875&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43875&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43875&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43875&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43875&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43875&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43875&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43875&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43875&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43875&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43875&r=support Expected behavior: http://bugs.php.net/fix.php?id=43875&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43875&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43875&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43875&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43875&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43875&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43875&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43875&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43875&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43875&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43875&r=mysqlcfg