Greetings.
>>
The main problem arises from the ambiguity for $array[-1] for arrays.>>
But this is easily solvable: just introduce a slice operator.
>>
>>
$array[:-1] and the ambiguity is gone.
>That would return an array
containing the last item as the sole member, >not the last item
itsel
On Tue, Sep 4, 2012 at 6:31 PM, David Zülke wrote:
> On 03.09.2012, at 09:37, Jannik Zschiesche wrote:
>
> > The main problem arises from the ambiguity for $array[-1] for arrays.
> > But this is easily solvable: just introduce a slice operator.
> >
> > $array[:-1] and the ambiguity is gone.
>
> T
On 4 Sep, 2012, at 3:59 AM, Stas Malyshev wrote:
> Hi!
>
>> The terminology "negative indexing" seems to imply that the feature
>> should work with arrays. To restrict it to just strings might involve
>> creating a term one would only associate with strings.
>
> I do not see any way to change
On 03.09.2012, at 09:37, Jannik Zschiesche wrote:
> The main problem arises from the ambiguity for $array[-1] for arrays.
> But this is easily solvable: just introduce a slice operator.
>
> $array[:-1] and the ambiguity is gone.
That would return an array containing the last item as the sole me
Hi!
> The terminology "negative indexing" seems to imply that the feature
> should work with arrays. To restrict it to just strings might involve
> creating a term one would only associate with strings.
I do not see any way to change behavior of $array[-1] that would make
sense. So either only st
>as I understood, a lot of people seem to have problems with this proposal,
>since arrays and strings could (and maybe >should) behave the same.
The terminology "negative indexing" seems to imply that the feature should work
with arrays. To restrict it to just strings might involve creating a te
Am Sonntag, 2. September 2012 um 02:43 schrieb sle...@pipeline.com:
> The idea was originally proposed by Marc Easen who created a patch and asked
> for help with putting together an RFC. I have yet to see a formal proposal
> but on the list Easen modified his idea so that it should apply to stri
>I see how this may work for strings and simple vectors, but what about this:
>
>$a = array(-1 => "foo", -2 => "bar"); echo $a[-1];
>
>It should keep returning "foo", right? So then the question is - what
>$array[-1] actually means?
Context would be the deciding factor, i.e. perhaps restrict the
Stas Malyshev wrote:
Stanislav I though that the discussion on adding this type of functionality to
>strings was already a done deal? Despite the obvious problems it introduces.
I'm not sure what you mean by "done deal". There was this RFC:
https://wiki.php.net/rfc/strncmpnegativelen
but that wa
Hi!
> Stanislav I though that the discussion on adding this type of functionality
> to
> strings was already a done deal? Despite the obvious problems it introduces.
I'm not sure what you mean by "done deal". There was this RFC:
https://wiki.php.net/rfc/strncmpnegativelen
but that wasn't implem
Stas Malyshev wrote:
>The idea was originally proposed by Marc Easen who created a patch
>and asked for help with putting together an RFC. I have yet to see a
>formal proposal but on the list Easen modified his idea so that it
>should apply to strings alone. With that in mind, would it really
>
Hi!
> The idea was originally proposed by Marc Easen who created a patch
> and asked for help with putting together an RFC. I have yet to see a
> formal proposal but on the list Easen modified his idea so that it
> should apply to strings alone. With that in mind, would it really
> cause problem
12 matches
Mail list logo