svn: /phpdoc/en/trunk/language/types/ string.xml
| From: | Adam Harvey | Date: | Wed, 14 Nov 2012 02:10:57 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/types/ string.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-10712@lists.php.net to get a copy of this message | ||
aharvey Wed, 14 Nov 2012 02:10:57 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=328351
Log:
Warn users about the perils of multi-byte strings and direct character access.
Or, as xkcd put it today, if it starts pointing toward space you are having a
bad problem and you will not go to space today.
Fixes doc bug #63079 (String access by character is not multibyte-safe).
Bug: https://bugs.php.net/63079 (Assigned) String access by
character is not multibyte-safe
Changed paths:
U phpdoc/en/trunk/language/types/string.xml
Modified: phpdoc/en/trunk/language/types/string.xml
===================================================================
--- phpdoc/en/trunk/language/types/string.xml 2012-11-13 16:34:37 UTC (rev 328350)
+++ phpdoc/en/trunk/language/types/string.xml 2012-11-14 02:10:57 UTC (rev 328351)
@@ -763,6 +763,15 @@
</simpara>
</warning>
+ <warning>
+ <simpara>
+ Internally, PHP strings are byte arrays. As a result, accessing or
+ modifying a string using array brackets is not multi-byte safe, and
+ should only be done with strings that are in a single-byte encoding such
+ as ISO-8859-1.
+ </simpara>
+ </warning>
+
<example>
<title>Some string examples</title>
<programlisting role="php">