Re: array_seek function
| From: | Derick Rethans | Date: | Thu, 15 Apr 2010 11:08:50 +0000 |
| Subject: | Re: array_seek function | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47968@lists.php.net to get a copy of this message | ||
On Tue, 13 Apr 2010, Felix De Vliegher wrote:
> >>>> Update:
> >>>> http://phpbenelux.eu/array_seek-return.patch.txt
> >>>> I've kept the fseek()-style return values (0 when fine, -1 when seek
> >>>> fails)
> >>>
> >>> Any reason why you picked that over the (IMO more logical) true/false
> >>> approach?
> >>
> >> No, it makes more sense to use the boolean return values, I was just
> >> using your fseek() analogy. Although I still find it useful to return
> >> the seeked value, and false when seek fails (basically how next(),
> >> reset() and friends behave).
> >
> > Has this been added to trunk now? Or not yet?
>
> No, still have it lying around. Can I commit this?
Dunno... did you go with true/false in the end, or returning the value?
I just realize that in the latter case you wouldn't be able to see
whether the seek actually worked, because every value could be a
"correct" value. I'd prefer the true/false thing still because of that.
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug