PHP Memcache::get modifies his second argument

Brian Moon brianm at dealnews.com
Thu Nov 30 22:29:09 UTC 2006


You really should report this as a bug if you feel it is one.  At the 
minimum it should be documented.

http://pecl.php.net/bugs/search.php?cmd=display&status=Open&package_name[]=memcache

Veres Lajos wrote:
> Hello,
> 
> print   "key:$key<br>";
> memcache_get($server,$key);
> print   "key:$key<br>";
> 
> And it returns:
> key:sql/select field from table where xyz...
> key:sql/select_field_from_table_where_xyz...
> 
> It seems memcache_get modifies his second argument.
> 
> As I checked now, Im not the first experiencing this:
> http://www.php.net/manual/en/function.memcache-get.php
> (see notes)
> 
> This is a feature or a bug?
> 
> (After 2 hours debuging i choose bug... :-)
> 
> I tried to workaround:
> $tmp=$key;
> print   "key:$key<br>";
> memcache_get($server,$tmp);
> print   "key:$key<br>";
> 
> Same response:
> key:sql/select field from table where xyz...
> key:sql/select_field_from_table_where_xyz...
> 
> $tmp=$key.'';
> worked finaly.
> 
> It seems it changing only if argument can be usable as a reference.
> And handles well if not:
> 
> memcache_get($server,$key.'');
> works fine.
> 
> memcache_set seems to have the same behaviour.
> (probably other functions too)
> 


-- 

Brian Moon
-------------
http://dealnews.com/
It's good to be cheap =)


More information about the memcached mailing list