Skip to content

Conversation

@vadimonus
Copy link
Contributor

@vadimonus vadimonus commented Nov 22, 2025

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

@github-actions
Copy link

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.

@vadimonus vadimonus force-pushed the memo-cache-with-empty-prefix branch from 01425c9 to cc19412 Compare November 22, 2025 08:31
@vadimonus vadimonus changed the title [12.x] Error in MemoizedStore when prefix empty [12.x] Incorrect result of MemoizedStore::many with numeric keys and empty prefix Nov 22, 2025
@vadimonus vadimonus force-pushed the memo-cache-with-empty-prefix branch from 0d947fc to 9264a02 Compare November 22, 2025 08:51
@vadimonus vadimonus marked this pull request as ready for review November 22, 2025 08:55
@taylorotwell taylorotwell merged commit 2849cd6 into laravel:12.x Nov 23, 2025
74 checks passed
@vadimonus vadimonus deleted the memo-cache-with-empty-prefix branch November 23, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants