[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] [doc-en] master: False isn't allowed for substr()'s $length (#984)
From:       Kévin_Dunglas_via_GitHub <noreply () php ! net>
Date:       2022-03-30 21:40:18
Message-ID: 1ZwgTc2a1meF1OSxOdYYMqsPTb5Fe9bzjSWSEoXOLI () main ! php ! net
[Download RAW message or body]

Author: Kévin Dunglas (dunglas)
Committer: GitHub (web-flow)
Pusher: Crell
Date: 2022-03-30T16:37:31-05:00

Commit: https://github.com/php/doc-en/commit/15247c75e1306d47898715dec11445edf4405dcc
Raw diff: https://github.com/php/doc-en/commit/15247c75e1306d47898715dec11445edf4405dcc.diff


False isn't allowed for substr()'s $length (#984)

Changed paths:
  M  reference/strings/functions/substr.xml


Diff:

diff --git a/reference/strings/functions/substr.xml \
b/reference/strings/functions/substr.xml index 36e3ac16e3e..23d2ad869af 100644
--- a/reference/strings/functions/substr.xml
+++ b/reference/strings/functions/substr.xml
@@ -91,7 +91,7 @@ $rest = substr("abcdef", -3, 1); // returns "d"
        an empty string will be returned.
       </para>
       <para>
-       If <parameter>length</parameter> is omitted, the substring starting from
+       If <parameter>length</parameter> is omitted or &null;, the substring starting \
from  <parameter>offset</parameter> until the end of the string will be
        returned.
       </para>
@@ -137,6 +137,8 @@ $rest = substr("abcdef", -3, -1); // returns "de"
       <entry>8.0.0</entry>
       <entry>
        <parameter>length</parameter> is nullable now.
+       When <parameter>length</parameter> is explicitly set to &null;,
+       the function returns a substring finishing at the end of the string, when it \
previously returned an empty string.  </entry>
      </row>
      <row>

-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic