PHP 8.5 Release Announcement
3 days ago
- #PHP
- #Web Development
- #Programming
- PHP 8.5 introduces a built-in URI extension for parsing and handling URLs according to RFC 3986 and WHATWG standards.
- The new pipe operator (|>) enables chaining callables left-to-right for cleaner code without intermediary variables.
- Enhanced clone() syntax allows modifying properties during object cloning, simplifying the 'with-er' pattern for readonly classes.
- The #[\u005CNoDiscard] attribute warns when a function's return value is unused, improving API safety.
- Static closures and first-class callables can now be used in constant expressions, including attribute parameters.
- Persistent handles reduce overhead by reusing connections across PHP requests.
- New array_first() and array_last() functions simplify accessing array elements.
- Deprecations include shell_exec(), certain type casts, and the disable_classes INI setting.
- New attributes like #[\u005COverride] and #[\u005CDeprecated] enhance code safety and clarity.
- Improvements in Dom\Element methods and new functions like grapheme_levenshtein() expand PHP's capabilities.