Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Use PHP 8.4 array helpers #53426

Closed
wants to merge 2 commits into from

Conversation

jnoordsij
Copy link
Contributor

@jnoordsij jnoordsij commented Nov 6, 2024

PHP 8.4 introduces new array search functions for finding items matching criteria or determining if any/all of them pass. See also https://php.watch/versions/8.4/array_find-array_find_key-array_any-array_all.

This PR introduces these helpers in the Arr and Collection classes to use 'modern' logic for the case where these functions are available. If in the future the minimal PHP version is 8.4, this will allow for further simplification by removing the old logic altogether.

Requires #52633 to be merged or to be merged into #52633.

@jnoordsij jnoordsij force-pushed the use-php-array-helpers branch 2 times, most recently from 66e1f23 to 7ae23bc Compare November 6, 2024 18:24
@crynobone
Copy link
Member

crynobone commented Nov 7, 2024

Hi there, can you rebase this PR to php84? We're working on proper support for PHP 8.4 on that branch.

Adding this wouldn't include PHP 8.4 on our CI build is highly dangerous.

@crynobone crynobone marked this pull request as draft November 7, 2024 00:24
@jnoordsij jnoordsij force-pushed the use-php-array-helpers branch from 7ae23bc to 674c8d4 Compare November 7, 2024 08:27
@jnoordsij jnoordsij changed the base branch from 11.x to php84 November 7, 2024 08:27
@jnoordsij jnoordsij marked this pull request as ready for review November 7, 2024 08:29
@taylorotwell
Copy link
Member

If the current code is working I would just leave it. 🤷‍♂️

@jnoordsij jnoordsij deleted the use-php-array-helpers branch November 8, 2024 06:58
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.

3 participants