PHPSocialNetwork / phpfastcache

A high-performance backend cache system. It is intended for use in speeding up dynamic web applications by alleviating database load. Well implemented, it can drops the database load to almost nothing, yielding faster page load times for users, better resource utilization. It is simple yet powerful.
https://www.phpfastcache.com
MIT License
2.38k stars 451 forks source link

Bug in the PSR-16 getMultiple method #831

Closed Awilum closed 3 years ago

Awilum commented 3 years ago

Configuration

PhpFastCache version: 8.0.8 PhpFastCache API version: 3.0.0 PHP version: 7.4.2 Operating system: macOS (but it is affect any)

I can't get default value from getMultiple method by using Psr16Adapter.

Example:

$values = ['foo' => 'Foo', 'bar' => 'Bar'];
$ttl = 300;
$cache->setMultiple($values, $ttl);

var_dump($cache->getMultiple(['zed', 'ted'], 'Default'));

Actual result:

array(2) {
  ["zed"]=>
  NULL
  ["ted"]=>
  NULL
}

Excepted result:

array(2) {
  ["zed"]=>
  string(7) 'Default'
  ["ted"]=>
 string(7) 'Default'
}

or Excepted result if var_dump($cache->getMultiple(['zed', 'ted'], ['Default1', 'Default2']));

array(2) {
  ["zed"]=>
  string(8) 'Default1'
  ["ted"]=>
 string(8) 'Default2'
}
github-actions[bot] commented 3 years ago

Hello curious contributor ! Since it seems to be your first contribution, make sure that you've been:

Geolim4 commented 3 years ago

hello,

Please reformat the issue using the template issue.

Thanks.

Awilum commented 3 years ago

@Geolim4 updated