symfony/polyfill-php81
Symfony Polyfill for PHP 8.1 features on older runtimes. Adds array_is_list, enum_exists, MYSQLI_REFRESH_REPLICA, ReturnTypeWillChange, and CURLStringFile (PHP 7.4+). Drop-in Composer dependency for wider compatibility.
Php81\*), preventing collisions with Laravel’s core or third-party packages. Example: Php81\array_is_list() won’t override Laravel’s built-in array_is_list if/when it’s added natively.array_keys($data) === range(0, count($data)-1)) with Php81\array_is_list().PaymentStatus::PENDING) in PHP 7.4–8.0, future-proofing code for PHP 8.1+.use Symfony\Polyfill\Php81\Php81;
if (Php81\array_is_list($request->all())) { ... }
Php81\* functions, minimizing risk of unintended behavior. No global overrides or Laravel core modifications.Validator facade for stricter payload checks.protected $status;) without PHP 8.1.CURLStringFile polyfill supports modern file uploads in Http::post() without PHP 8.1.ReturnTypeWillChange could interact with Laravel’s internal method return type hints (e.g., in service containers), but this is rare and unlikely to affect most use cases.array_is_list() in high-throughput API routes).Php81\* calls with native functions.Fibers, read_only properties, match expressions). Verify Symfony’s feature list before adoption.array_is_list([null, 1]) might return true in the polyfill but false in PHP 8.1).array_is_list/enum_exists over niche features like MYSQLI_REFRESH_REPLICA.)Php81\array_is_list() in a high-traffic API endpoint.array_is_list logic) with lower overhead for critical paths?Php81\array_is_list([null, 1]) may return true unexpectedly in some PHP 7.4–8.0 environments.ramsey/array_is_list)? Audit composer.json for overlapping functionality.Str::of() enhancements) that could replace this for certain use cases?symfony/var-dumper, symfony/error-handler), so this requires zero additional configuration.Php81\array_is_list() in Validator rules or Php81\enum_exists() for domain models.array_is_list in validation layers.How can I help you explore Laravel packages today?