On Fri, 29 Jun 2001, Jeroen van Wolffelaar wrote:

> > This works fine: $i will contain, -3, -2, -1 and 0 (and not -0), but
> > indeed I agree that substr ('str', 0, 0) should return this: 'str'. This
> > change can be easily made in the current sources. If nobody objects, I'll
> > change it.
>
> This is IMO 'van de regen in de drup', i.e. making it worse... The kind of
> loop I mentioned isn't as current as a loop like this:
>
> for ($i=5;$i>=0;$i--)
> substr('abcdef',0,$i);
>
> wich your proposed change, you get:
> (i=5) abcde
> 4 abcd
> 3 abc
> 2 ab
> 1 a
> 0 abcdef !

Indeed, I read it wrong, but anyway, the current implementation returns an
empty string (''), so I really don't see what the problems with substr
are.

Derick


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to