Re: Re: Negative string offset support

From: Date: Sun, 31 Oct 2004 22:35:22 +0000
Subject: Re: Re: Negative string offset support
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-13650@lists.php.net to get a copy of this message
Hello Rasmus, Sunday, October 31, 2004, 11:27:40 PM, you wrote: > On Sun, 31 Oct 2004, moshe doron wrote: >> where the problem about 'taking it ever further'? >> I'm +1 for {-1} and more +1 for {-4,2} python likeness. > That starts getting confusing. I assume that translates to the 3rd and > 4th chars from the end of the string. And, to verify that I went and > looked it up and it turns out that's not the case in Python. They use > [start_index:end_index] so [-4:2] would be the 4th char from the end until > the 2nd char in the string, so for a 6 char string or longer that would > return nothing, but worse, my initial guess at what it did was wrong. I > don't like features where my first guess at what something does is wrong. Same from here. If we do it it should behave like a short form of substr. Best regards, Marcus mailto:helly@php.net

« previous php.internals (#13650) next »