[PHP-BUG] Bug #75141 [NEW]: implode returns NULL at times.

[email protected] ("abeal at eelzee dot com") Thu, 31 Aug 2017 20:27:24 GMT
Newsgroups php.standards
Message-ID <[email protected]>
From:             abeal at eelzee dot com
Operating system: ANY
PHP version:      5.6.31
Package:          PHP Language Specification
Bug Type:         Bug
Bug description:implode returns NULL at times.

Description:
------------
---
From manual page: http://www.php.net/function.implode
---
It seems that in certain cases, implode returns NULL.  This seems in
violation of the specification.

One of the commenters mentions that it will do so if passed a string as
well.  Should this not be rectified, at least for future versions?  If
not, should the documentation be updated to reflect the circumstances
where NULL is returned instead of an empty string?


Test script:
---------------
// Prints "TRUE";
print "Is null: " . (NULL === implode(" - ", [])) ? "TRUE" : "FALSE";


-- 
Edit bug report at https://bugs.php.net/bug.php?id=75141&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75141&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75141&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75141&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75141&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75141&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75141&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75141&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75141&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75141&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75141&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75141&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75141&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75141&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75141&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75141&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75141&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75141&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75141&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75141&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75141&r=mysqlcfg