You could make the type work with flags rather than type so as not to need an 
additional argument.

So you would declare the mix and match of start/next units and length units as 
flag1+flag2
Where both flag1 and flag2 would have appropriate defaults for a value of 0.
Flag1 would use bits 4-6 and flag2 bits in the range 1-3 or some such.

Don't hate me it is just a suggestion.

> -----Original Message-----
> From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 13, 2008 2:43 PM
> To: Ed Batutis
> Cc: Texin, Tex; php-i18n@lists.php.net
> Subject: Re: [PHP-I18N] proposal: unification of the 
> grapheme_extract functions
> 
> 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]
> 

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to