krakjoe / apcu

APCu - APC User Cache
Other
957 stars 193 forks source link

`apcu_fetch` returns `success` for missing keys #509

Open boesing opened 2 months ago

boesing commented 2 months ago

Hey there,

I am using APCu on PHP 8.1 with v5.1.23. When I execute apcu_fetch with a key which does not exist, $success flag is being set to true and false is returned.

$value = apcu_fetch(bin2hex(random_bytes(10)), $success);
var_dump($value, $success);
bool(false)
bool(true)

Do I miss something? AFAIR apcu_fetch returned false on success when cache key did not exist?

nikic commented 2 months ago

I can't reproduce this. For me this prints false two times.

boesing commented 2 months ago

Maybe this is related to MacOS and/or patches of shivammathur. Will double check that. Sorry for creating noise.