- 
                Notifications
    You must be signed in to change notification settings 
- Fork 11.6k
Closed
Description
Laravel Version
11.30.0
PHP Version
8.3.13
Database Driver & Version
No response
Description
I recently upgraded from Laravel 10.48.22 to Laravel 11.30.0 and all implementations of
cache()->remember($key, $value, now()->addSecond()) have broke.
However, this works:
cache()->remember($key, $value, 1)
Switching back to Laravel 10 fixed the issue.
I'm not sure if this is intentional or not - but it's undocumented and it caused our app to break.
Both tests for Laravel 10 + 11 using Carbon 2.72.5.
Steps To Reproduce
Just run the following:
return [
  cache()->put("test_1", true, now()->addSecond()), 
  cache()->put("test_1", true, 1), 
  cache()->put("test_2", true, now()->addSeconds(2))
];And it will output:
[
    false,
    true,
    true,
  ]Interestingly, if the order changes, then it will output as true for all values.
return [
cache()->put("test_1", true, 1), 
cache()->put("test_1", true, now()->addSecond()), 
cache()->put("test_2", true, now()->addSeconds(2))
];will output:
[
    true,
    true,
    true,
  ]Metadata
Metadata
Assignees
Labels
No labels

