symfony/polyfill-php81
Symfony polyfill providing PHP 8.1 features on older PHP versions: array_is_list, enum_exists, ReturnTypeWillChange, MYSQLI_REFRESH_REPLICA, and CURLStringFile.
array_is_list, enum_exists) while deferring costly runtime upgrades. This supports roadmap decisions to ship value now and migrate infrastructure on a planned timeline.OrderStatus, PaymentStatus) or cleaner validation logic—without waiting for a platform upgrade. Product can prioritize user-facing features over infrastructure churn.array_is_list() in API request validation and data pipelines.ReturnTypeWillChange and other polyfilled features to reduce friction during future PHP upgrades.array_is_list.For executives: This is a low-risk bridge that lets us use selected PHP 8.1 features—such as enums and stricter array validation—on our current Laravel/PHP platform. It is MIT-licensed, Symfony-maintained, and installs through Composer with no application rewrite. It helps us ship roadmap features sooner, avoid custom compatibility code, and defer infrastructure upgrades until planned. The tradeoff is a temporary dependency and minor per-call overhead; it is not a replacement for eventually upgrading PHP, especially given PHP 7.4’s end-of-life security risk.
For engineering: symfony/polyfill-php81 provides namespaced, opt-in implementations of PHP 8.1 features for PHP 7.4–8.0 environments. Adoption is simple: composer require symfony/polyfill-php81, then use the polyfilled functions or constants where needed. It requires no Laravel service provider or configuration and avoids conflicts with native PHP 8.1+ behavior. Use it for targeted cases—validation with array_is_list(), enums in domain models, or third-party compatibility—not as a blanket modernization strategy. Add tests for edge cases, benchmark critical paths, document the PHP-version constraint, and plan to remove the dependency once the application runs on PHP 8.1+.
How can I help you explore Laravel packages today?