What's New in PHP 8.6(php.net)
294 points by netol 10 days ago | 144 comments
tl;dr: PHP 8.6 introduces Partial Function Application (using `?` and `...` placeholders), a new `Time\Duration` class for precise elapsed-time handling, and an `Io\Poll` API that enables scalable I/O multiplexing via epoll/kqueue for event loop libraries. Other additions include a `clamp()` function, a `SortDirection` enum, readonly property defaults, per-parameter DocComments, structured stream error handling with exceptions, and stricter session defaults. Notable deprecations include `return` in `finally` blocks, mbstring regex functions (Oniguruma is unmaintained), and various legacy type-check aliases like `is_long()` and `is_double()`.
HN Discussion:
  • •Security vulnerability concerns should take priority over excitement about the new release
  • ↑Enthusiasm for specific new features like ZTS improvements and function partials
  • ~Mixed feelings about Partial Function Application due to syntactic ambiguity with invocations
  • ↓Disappointment that certain type system improvements (like argument count limits) are still missing
  • ↑Frustration with HN's dismissive snark toward PHP, defending the language's strengths