[12.x] Incorrect result of MemoizedStore::many with numeric keys and empty prefix#57862
Merged
taylorotwell merged 2 commits intoNov 23, 2025
Merged
Conversation
|
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
01425c9 to
cc19412
Compare
0d947fc to
9264a02
Compare
akyrey
pushed a commit
to akyrey/framework
that referenced
this pull request
Dec 29, 2025
…empty prefix (laravel#57862) * [12.x] MemoizedStoreTest with empty prefix * [12.x] MemoizedStore fix with empty prefix and numeric keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When underlying cache in MemoizedStore has emplty prefix (null or '' like in ArrayStore), it may work incorrectly with integer and numeric string keys.
Failing test example https://github.com/laravel/framework/actions/runs/19592949064/job/56113726066
That's because of PHP's specifics of merging arrays with numeric keys (see https://www.php.net/manual/en/function.array-merge.php , for demo https://onlinephp.io?s=s7EvyCjg5eLlKkssik8pzS3QiObl4tTT04uO1YEyeLkUoEDdUF3B1k5BPT8vVV0HSdgAIlyVWpQPEucEaY3VtOblAgA%2C&v=8.3.21)
Previous fix in same method in #55503