Doc #74228 [Asn->Csd]: Documentation for substr_replace() when 'start' is zero
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)