Doc #80975 [NEW]: Doc incomplete - explode
From: jon at buymydreamhotel dot com
Operating system: Ubuntu
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Doc incomplete - explode
Description:
------------
The documentation for explode() is incomplete,it does not define the
behaviour when separator is found at the start or end of the string to
be split. Compare doc for similar JS function here.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
"If separator appears at the beginning (or end) of the string, it still
has the effect of splitting. The result is an empty (i.e. zero length)
string, which appears at the first (or last) position of the returned
array."
The behaviour reported above for the JS equivalent appears to be correct
for the PHP explode() function, at least in my code for a '/' at the end
of a URL.
I think the common use of '/' at the end of URLs makes a case for making
sure this is precisely documented.
--
Edit bug report at https://bugs.php.net/bug.php?id=80975&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80975&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80975&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80975&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80975&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80975&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80975&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80975&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80975&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80975&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80975&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80975&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80975&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80975&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80975&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80975&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80975&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80975&r=mysqlcfg
Thread (3 messages)
- jon at buymydreamhotel dot com