ID:               42789
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kraghuba at in dot ibm dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Strings related
 Operating System: windows/linux
 PHP Version:      5CVS-2007-09-28 (snap)
 New Comment:

Fixed in CVS. (I removed the part about 'joining' altogether, it's
obvious from the error message anyway) Also made the return value same
in both 5.3 and HEAD.


Previous Comments:
------------------------------------------------------------------------

[2007-09-30 14:37:23] [EMAIL PROTECTED]

join() is an alias of implode(), so the error messages is correct.

------------------------------------------------------------------------

[2007-09-28 16:25:49] kraghuba at in dot ibm dot com

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 this bug report at http://bugs.php.net/?id=42789&edit=1

Reply via email to