Doc #74228 [Asn->Csd]: Documentation for substr_replace() when 'start' is zero

From: Date: Thu, 09 Mar 2017 11:07:14 +0000
Subject: Doc #74228 [Asn->Csd]: Documentation for substr_replace() when 'start' is zero
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14489@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74228&edit=1

 ID:                 74228
 Updated by:         peehaa@php.net
 Reported by:        direvus at gmail dot com
 Summary:            Documentation for substr_replace() when 'start' is
                     zero
-Status:             Assigned
+Status:             Closed
 Type:               Documentation Problem
 Package:            Documentation problem
 PHP Version:        Irrelevant
 Assigned To:        peehaa
 Block user comment: N
 Private report:     N

 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.




Previous Comments:
------------------------------------------------------------------------
[2017-03-09 07:02:27] direvus at gmail dot com

Description:
------------
---
From manual page: http://www.php.net/function.substr-replace
---

The description of the 'start' argument says:

"""
    If start is positive, the replacing will begin at the start'th offset into string.

    If start is negative, the replacing will begin at the start'th character from the end of
string.
"""

This fails to account for the case where 'start' is zero.  Instead of
"positive", it should say "non-negative", or "positive or zero", or
"greater than or equal to zero".


Test script:
---------------
print substr_replace('bar', 'foo', 0);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74228&edit=1


Thread (2 messages)

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