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).


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328351 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Harvey 2012-11-14 02:10:57 +00:00
parent 3ee6fa8a65
commit 13995e9311

View file

@ -763,6 +763,15 @@ echo "I'd like an {${beers::$ale}}\n";
</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">