Skip to content

Modernize array utilities and JSON validation using PHP 8.4+ functions with polyfills#7523

Open
huangdijia wants to merge 10 commits intohyperf:3.2from
huangdijia:3.2-add-polyfill-php
Open

Modernize array utilities and JSON validation using PHP 8.4+ functions with polyfills#7523
huangdijia wants to merge 10 commits intohyperf:3.2from
huangdijia:3.2-add-polyfill-php

Conversation

@huangdijia
Copy link
Member

No description provided.

@huangdijia huangdijia added this to the v3.2 milestone Sep 4, 2025
Replaced custom JSON validation logic with direct calls to json_validate in Str and ValidatesAttributes. Updated composer.json files to require symfony/polyfill-php83, php84, and php85 for improved PHP compatibility. Refactored array utility usage in Arr and Collection for consistency and performance.
Replaces array_key_exists with isset in the has and hasAny methods for improved performance and to ensure only non-null keys are considered present.
Simplifies the Arr::first method by delegating to array_first directly. Also corrects the locale string in CollectionTest from 'en_US.utf8' to 'en_US.UTF-8' for consistency.
@huangdijia huangdijia force-pushed the 3.2-add-polyfill-php branch from cec432f to 46a1de3 Compare November 4, 2025 10:14
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.

1 participant