php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57409 PHP Memcache::get modifies his second argument
Submitted: 2006-11-30 18:02 UTC Modified: 2006-11-30 18:16 UTC
From: mmc at lavela dot hu Assigned:
Status: Closed Package: memcache (PECL)
PHP Version: 4.4.4 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mmc at lavela dot hu
New email:
PHP Version: OS:

 

 [2006-11-30 18:02 UTC] mmc at lavela dot hu
Description:
------------
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)


(I sent this email to the memcached mailing list. They forwarded me here.)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-30 18:04 UTC] mmc at lavela dot hu
(PHP version is 4.4.4 not 4.4.3 sorry)
 [2006-11-30 18:16 UTC] tony2001 at phpclub dot net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

http://news.php.net/php.pecl.cvs/6716
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 19:01:28 2024 UTC