Re: [PHP-I18N] proposal: unification of the grapheme_extract functions
[email protected] (Stanislav Malyshev) Tue, 13 May 2008 14:42:53 -0700
| Newsgroups | php.i18n |
|---|---|
| Organization | Zend Technologies |
| Message-ID | <[email protected]> |
Hi! > Add a new optional parameter on the end - called $next - that > is a reference that will receive the offset just past the > end of the returned string. OK, it may be even better. > I will add the three options for the meaning of 'start' as well with the > default being 'byte'. The returned $next value will respect the value of > that option. > > If no one objects I'll put that in. That would make it six-parameter function? I think it's too much, just bytes should be enough... Note that if you receive $start in something other than bytes you'd need to re-scan the string next time to know where to start, even though you already had this information at the last call. So you lose part of the performance gain of having this offset. If you not looping but just need to start with Nth grapheme, you can always go for grapheme_substr. Also, I agree with Tex on wanting to release it ASAP and it seems like this issue is the last one. So I think let's make it just bytes with optional $next, document it and start rolling out 1.0.0. -- Stanislav Malyshev, Zend Software Architect [email protected] http://www.zend.com/ (408)253-8829 MSN: [email protected]