Newsgroups: php.i18n,php.internals Path: news.php.net Xref: news.php.net php.i18n:1016 php.internals:24201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 605 invoked by uid 1010); 23 Jun 2006 21:16:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 583 invoked from network); 23 Jun 2006 21:16:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2006 21:16:11 -0000 X-Host-Fingerprint: 80.123.98.46 unknown Received: from ([80.123.98.46:13921] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id E2/40-02438-A1A5C944 for ; Fri, 23 Jun 2006 17:16:11 -0400 To: php-i18n@lists.php.net,internals@lists.php.net,Andrei Zmievski Message-ID: <449C5A1A.3080407@php.net> Date: Fri, 23 Jun 2006 23:16:10 +0200 User-Agent: Thunderbird 1.5.0.2 (X11/20060522) MIME-Version: 1.0 References: <23ead5a35bff30e24f93045de3db6638@gravitonic.com> In-Reply-To: <23ead5a35bff30e24f93045de3db6638@gravitonic.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.123.98.46 Subject: Re: TextIterator changes From: mike@php.net (Michael Wallner) Andrei Zmievski wrote: > I am working on implementing BreakIterator API [1]. I considered two > approaches: making a separate class or merging the API into the existing > TextIterator. Having a separate class would be a bit cleaner, but I can > see people wanting to use it in foreach(), and since TextIterator > already provides a lot of BreakIterator's functionality, I decided that > merging would be the best option. However, there is an overlap between > the BreakIterator API and the current TextIterator one, so there will > have to be some changes. > > 1. TextIterator::current() signature will change from: > > mixed current() > > to: > > mixed current(integer &$offset) This will raise the same issue as we have/had with the reflection API: mike@honeybadger:~/build/php-unicode-debug$ cli -r 'interface i{function f();} class c implements i{function f($a){}}' Fatal error: Declaration of c::f() must be compatible with that of i::f() in Command line code on line 1 Nah, don't look at me--I don't like that either. > 3. TextIterator::rewind() will be renamed to TextIterator::first() to > conform to BreakIterator's first()/last() API. > > So this is heads up. Let me know if you have a problem with this. Huh? Rename or alias? It can't implement Iterator if there's no rewind() method. Regards, -- Michael