|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-05-29 22:57 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 11:00:02 2025 UTC |
Description: ------------ Memcache somehow obtains a reference where none exists. In the example, I set $clave to a string, set $keyword to a copy of $clave (since $clave is a string, I'm assuming it internally is copied by value, not reference, as per the docs?), and then do something with $clave. At the end of this mucking, $keyword is changed, replacing a space with an underscore. The problem does NOT occur if I say $keyword = substr($clave, 0); instead of $keyword = $clave, so I'm assuming it's somehow obtaining a reference? (The script starts and ends at the <?php and ?> sections, there's nowhere that says global $keyword or anything). The memcached server version is 1.2.1, running on Apache 2.0.53. Reproduce code: --------------- <?php $a = memcache_pconnect("192.168.1.252", 11211); $clave = "abc 123"; $keyword = $clave; echo "K: ".$keyword."<br/>"; $a->get($clave); echo "K: ".$keyword."<br/>"; ?> Expected result: ---------------- K: abc 123 K: abc 123 Actual result: -------------- K: abc 123 K: abc_123