From 13995e9311840c9bb4f936b120b3d3cd273ea035 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 14 Nov 2012 02:10:57 +0000 Subject: [PATCH] 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 --- language/types/string.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/language/types/string.xml b/language/types/string.xml index 7c5de901ea..1df67eb23d 100644 --- a/language/types/string.xml +++ b/language/types/string.xml @@ -763,6 +763,15 @@ echo "I'd like an {${beers::$ale}}\n"; + + + 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. + + + Some string examples