#26414 [Bgs->Csd]: No documentation on modifying a string by indexing and assignment
| From: | goba@php.net | Date: | Tue, 25 Nov 2003 22:46:47 +0000 |
| Subject: | #26414 [Bgs->Csd]: No documentation on modifying a string by indexing and assignment | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969357074@lists.php.net to get a copy of this message | ||
ID: 26414
Updated by: goba@php.net
Reported By: stephen dot fromm at verizon dot net
-Status: Bogus
+Status: Closed
Bug Type: Documentation problem
Operating System: irrelevant
PHP Version: Irrelevant
New Comment:
Closed, not bogus, as there was a confirmed bug and it was fixed. The
manual only documented access by index and not modification...
Previous Comments:
------------------------------------------------------------------------
[2003-11-25 17:01:29] ali@php.net
Here:
http://www.php.net/manual/en/language.types.type-juggling.php
you find the behaviour documented. I'll will add a small example to
the "Strings" section, so that it will be clarified and seen faster.
------------------------------------------------------------------------
[2003-11-25 16:17:20] stephen dot fromm at verizon dot net
Description:
------------
The PHP documentation nowhere indicates whether it's legal to *modify*
a string by accessing an individual character in the string with the
index operator (curly braces) and an assignment statement, as in:
$str = '0123456789';
$str{4} = 'd';
// Now $str should be '0123d56789'
While it does work on my machine, I feel the behavior
should be documented, as
* for all I know, there may be strange side effects (given php's
complex copy semantics);
* using undocumented language features can result in code that doesn't
age or port well;
* this is a fundamental aspect of any computer language.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26414&edit=1