Multiget/intelligent generic PHP wrapper function... thoughts /advice wanted

Brian Beuning BBeuning at corecard.com
Sat Nov 3 14:31:44 UTC 2007


 It seems to me getting this code right is a little tricky.
Just look at how long the thread has been.
To me that is a strong argument to add support for returning
the missing keys from the memcached API.
That way each user of memcached does not need to figure out
how to keep tack of not found keys.

Brian Beuning


-----Original Message-----
From: mike
To: Chris Goffinet
Cc: Memcached List
Sent: 11/3/2007 12:47 AM
Subject: Re: Multiget/intelligent generic PHP wrapper function...
thoughts/advice wanted

Yeah, apologies to all for going a little deeper OT.

I was planning on replying just to Chris, but thought I'd keep it in
on the list in case someone else cared.

Thanks for the pointers Chris, I am going with this code for now
(using the $dontcare=>$key in the loop) and will see how the app
works.

On 11/2/07, Chris Goffinet <goffinet at yahoo-inc.com> wrote:
> Yes I know that, hoping you could fix the code with the $key=>$value
> change.
>
>
> Array_keys is not clean because your simply calling an unneeded
> function on an already good array? Why on earth would you waste
> overhead (O(n)) when its simply on same line? ... I think this
> discussion has went really off topic as its not relating to memcache
> but more PHP.
>
>
> Chris Goffinet
> goffinet at yahoo-inc.com
>
>
>
> On Nov 2, 2007, at 10:28 PM, mike wrote:
>
> > On 11/2/07, Chris Goffinet <goffinet at yahoo-inc.com> wrote:
> >> The array_values is not needed, its already an array. Just set it
up
> >> as $key=>$value and do not do extra overhead.
> >
> > Actually it would be:
> >
> > foreach($keys as $dontcare => $key) {
> >
> > But wouldn't
> >
> > foreach(array_keys($keys) as $key) { be just as clean?
>
>


More information about the memcached mailing list