Sunday, November 13, 2022

[FIXED] What is the point of replace function in Memcache?

Issue

What is the point of replace function in PHP memcache if you can just use set? Even if there is a variable, set automatically replaces it, right?

Can you give me an example where it's better to use replace instead of set?

Thanks.


Solution

According to PHP.net:

Memcached::replace() is similar to Memcached::set(), but the operation fails if the key does not exist on the server.



Answered By - ZoFreX
Answer Checked By - David Goodson (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.