Skip to content

Commit

Permalink
Merge pull request #1 from zored/hotfix/default_value
Browse files Browse the repository at this point in the history
Fix default value.
  • Loading branch information
paillechat committed Aug 24, 2017
2 parents 1096359 + f1c14af commit c7a5169
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ApcuCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ public function get($key, $default = null)
$this->assertKeyName($key);
$key = $this->buildKeyName($key);

return apcu_fetch($key) ?:$default;
$value = apcu_fetch($key, $success);
if ($success === false) {
return $default;
}

return $value;
}

/**
Expand Down

0 comments on commit c7a5169

Please sign in to comment.