From: kraghuba at in dot ibm dot com Operating system: windows/linux PHP version: 5CVS-2007-09-28 (snap) PHP Bug Type: Strings related Bug description: join() warning messages are not proper & different return value on php5/6
Description: ------------ join() function doesn't generate proper warning messages when following conditions occur: 1) when join() is called with less than expected no. of argument, the warning message generated refers to implode function. Here is the actual output that is generated(in other warning it doesn't refer to implode function): Warning: join(): Argument to implode must be an array. in %s on line %d NULL 2) When the value of pieces argument is given other than an array, warning message generated is not giving enough info. It should be changed to indicate right required input type. Currently error message that get generated is as follows: Warning: join(): Bad arguments in C:\workdir\ibm\php6\ext\standard\tests\strings\join_variation2.php on line 89 bool(false) 3) the return value of this function differ on php5 and php6 when it generates an warning message: on php5, the return value is NULL on php6, the reutrn value is bool(false) I think, it should be consistent. Reproduce code: --------------- <?php $glue = ", "; var_dump( join($glue) ); // less than expected no. of args $pieces = 10; // not an array var_dump( join($glue, $pieces) ); ?> Actual result: -------------- on php6: --------- Warning: join(): Argument to implode must be an array in %s on line %d bool(false) Warning: join(): Bad arguments in %s on line %d bool(false) on php5: -------- Warning: join(): Argument to implode must be an array. in %s on line %d NULL Warning: join(): Bad arguments. in %s on line %d NULL -- Edit bug report at http://bugs.php.net/?id=42789&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42789&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42789&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42789&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42789&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42789&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42789&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42789&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42789&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42789&r=support Expected behavior: http://bugs.php.net/fix.php?id=42789&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42789&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42789&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42789&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42789&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42789&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42789&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42789&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42789&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42789&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42789&r=mysqlcfg