php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45593 change the way 'implode' handles NULL values
Submitted: 2008-07-22 15:18 UTC Modified: 2018-09-04 17:12 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: getmequick at gmail dot com Assigned:
Status: Suspended Package: Strings related
PHP Version: 5.2.6 OS: Win XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: getmequick at gmail dot com
New email:
PHP Version: OS:

 

 [2008-07-22 15:18 UTC] getmequick at gmail dot com
Description:
------------
I'd like to know if it's reasonable to have 'implode' function do not concatenate 'null/false' values into resulting string.

like it does 'http_build_query' (http://php.net/http_build_query)



Reproduce code:
---------------
<?php
$dirs		=  array(
'dir1',
'dir2',
false,
'dir3'
);

$dir_str    = implode( DIRECTORY_SEPARATOR, $dirs);
echo $dir_str; 
?>

Expected result:
----------------
dir1\dir2\dir3

Actual result:
--------------
dir1\dir2\\dir3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:23 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Strings related
 [2018-09-04 17:12 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2018-09-04 17:12 UTC] cmb@php.net
At least due to the resulting BC break this feature request
requires discussion on the internals@ mailing list, and perhaps an
RFC[1].  Anybody is welcom to start the discussion.  For the time
being, I'm suspending this ticket.

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC