Skip to content

The array_first helper function breaks in PHP =< 8.3 #56870

@erikverbeek

Description

@erikverbeek

Laravel Version

11 / 12

PHP Version

8.3.13

Database Driver & Version

No response

Description

Hello all,

The following pull request was merged yesterday: Prevent infinite loop on array_first, array_last, str_contains.

This fix uses the function array_find_key, which was introduced in PHP 8.4. This results in an Call to undefined function array_find_key error on our systems which are still running on 8.3.

Steps To Reproduce

Run the following code in PHP 8.3

 array_first([
   'en' => 'English',
   'nl' => 'Dutch',
   'it' => 'Italian',
   'fr' => 'French'
   ], fn($language, $languageCode) => $languageCode === 'nl');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions