-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
- Laravel Version: 5.7.27
- PHP Version: 7.2.15
Description:
Cache::has('key') returns true when its value is false, differing from the documentation:
Steps To Reproduce:
Copy + paste this code to a route, command, or test:
Cache::forever('foo_string', 'string');
Cache::forever('foo_0', 0);
Cache::forever('foo_1', 1);
Cache::forever('foo_true', true);
Cache::forever('foo_empty', '');
Cache::forever('foo_null', null);
Cache::forever('foo_false', false);
dd(
'These should be true:',
Cache::has('foo_string'),
Cache::has('foo_0'),
Cache::has('foo_1'),
Cache::has('foo_true'),
Cache::has('foo_empty'),
'These should be false:',
Cache::has('foo_null'),
Cache::has('foo_false') // <-- issue
);I've tried the above with these cache drivers: file, redis, memcached, array. Same result with each.
Metadata
Metadata
Assignees
Labels
No labels
