|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80975 Doc incomplete - explode
Submitted: 2021-04-22 09:23 UTC Modified: -
From: jon at buymydreamhotel dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
12 + 5 = ?
Subscribe to this entry?

 [2021-04-22 09:23 UTC] jon at buymydreamhotel dot com
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.

"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.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-29 14:48 UTC] hallberg dot kim at gmail dot com
The following pull request has been associated:

Patch Name: [80975] Fix: Doc incomplete - explode
On GitHub:
 [2021-04-29 16:03 UTC]
Automatic comment on behalf of thinkverse (author) and web-flow (committer)
Log: Fix #80975: Doc incomplete - explode
 [2021-04-29 16:03 UTC]
-Status: Open +Status: Closed
 [2021-04-29 17:39 UTC]
Automatic comment on behalf of mumumu
Log: Fix #80975: Doc incomplete - explode
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Sep 30 17:03:41 2022 UTC