Re: [RFC] ArrayIterator improvements
| From: | Wes | Date: | Tue, 22 Nov 2016 21:56:47 +0000 |
| Subject: | Re: [RFC] ArrayIterator improvements | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97132@lists.php.net to get a copy of this message | ||
I have decided to go with that because
1- I'm a fan of using Exceptions (mostly) for exceptional error conditions;
between these two
public seekKey($key):void throws WhateverException;
public seekKey($key):bool;
I (by far) prefer the latter.
2- I think it would require a new type of SPL Exception, because none of
the existing makes sense to use here, in my opinion.
2016-11-22 21:43 GMT+01:00 Nikita Popov <nikita.ppv@gmail.com>:
> On Tue, Nov 22, 2016 at 6:47 PM, Wes <netmo.php@gmail.com> wrote:
>
>> Greetings again PHPeople,
>>
>> I wanted to avoid the discussion for the small improvements I was
>> proposing
>> thinking it would be acceptable to do so (
>> http://news.php.net/php.internals/97118) but apparently I
>> was wrong
>> (sorry
>> for that), so here's the discussion thread!
>>
>> https://wiki.php.net/rfc/arrayiterator-improvements
>>
>> Again this is my first RFC, and I hope I'm doing nothing wrong this time
>> :P
>>
>> Thanks again,
>> Wes
>>
>> (and special thanks to Room11 for their feedback about the RFC process)
>>
>
> What's the reason for making seekKey() return a boolean? The existing
> seek() method throws an exception if the seek offset does not exist. It
> would make sense to me for seekKey() to throw an exception if the key does
> not exist, to keep things consistent.
>
> Nikita
>
>