Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53451 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7228 invoked from network); 20 Jun 2011 21:27:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 21:27:15 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:37087] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/53-22948-13BBFFD4 for ; Mon, 20 Jun 2011 17:27:14 -0400 Received: from [192.168.2.230] (ppp-93-104-43-78.dynamic.mnet-online.de [93.104.43.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 2C5617457B; Mon, 20 Jun 2011 23:27:09 +0200 (CEST) To: Robert Eisele Cc: Todd Ruth , Stas Malyshev , internals@lists.php.net In-Reply-To: References: <1308584208.6296.9.camel@guybrush> <1308586150.6296.13.camel@guybrush> <1308589044.8394.27.camel@inspiron> <4DFF7E2A.50506@sugarcrm.com> <1308591260.8394.47.camel@inspiron> Content-Type: text/plain; charset="UTF-8" Date: Mon, 20 Jun 2011 23:27:04 +0200 Message-ID: <1308605224.7135.2.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: foreach() for strings From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2011-06-20 at 20:38 +0200, Robert Eisele wrote: > I really like the ideas shared here. It's a thing of consideration that > array-functions should also work with strings. Maybe this would be the way > to go, but I'm more excited about the OOP implementation of TextIterator and > ByteIterator, which solves the whole problem at once (and is easier to > implement, as mentioned by Stas). As Jonathan said, Database results with a > certain encoding could get iterated, too. The only way to workaround the > Text/Byte problem would be, offsetting >EVERY< string with 1-2 byte > "string-type" information or an additional type flag in the zval-strcuture. > Handling everything with zval's instead of objects would have the advantage, > that database-layers like mysqlnd could write the database-encoding directly > into the zval and the user had no need to decide what encoding is used. Welcome back to the failed PHP 6 Unicode project. ;-) (while we didn't store the original encoding but converted to Utf-16, which prevents random/strange conversions in other places when mixing encodings) johannes