Doc #80975 [Opn->Csd]: Doc incomplete - explode

From: Date: Thu, 29 Apr 2021 16:03:27 +0000
Subject: Doc #80975 [Opn->Csd]: Doc incomplete - explode
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18742@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80975&edit=1 ID: 80975 Updated by: git@php.net Reported by: jon at buymydreamhotel dot com Summary: Doc incomplete - explode -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Ubuntu PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Automatic comment on behalf of thinkverse (author) and web-flow (committer) Revision: https://github.com/php/doc-en/commit/6b5de328b9dfb7aa391817b5cef123c80acd9979 Log: Fix #80975: Doc incomplete - explode Previous Comments: ------------------------------------------------------------------------ [2021-04-29 14:48:22] hallberg dot kim at gmail dot com The following pull request has been associated: Patch Name: [80975] Fix: Doc incomplete - explode On GitHub: https://github.com/php/doc-en/pull/558 Patch: https://github.com/php/doc-en/pull/558.patch ------------------------------------------------------------------------ [2021-04-22 09:23:31] jon at buymydreamhotel dot com 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 this bug report at https://bugs.php.net/bug.php?id=80975&edit=1

« previous php.doc.bugs (#18742) next »