Everything on php-8.4.
4 articles tagged php-8.4, sorted newest first.
Parse HTML5 Properly with PHP 8.4's Dom\HTMLDocument
For twenty years, parsing HTML in PHP meant fighting DOMDocument's mangled UTF-8 and XPath. PHP 8.4's Dom\HTMLDocument finally does it properly.
PHP 8.4: Chain Methods on new Without the Extra Parentheses
PHP 8.4 drops the wrapper parentheses around new, so (new Foo())->bar() becomes new Foo()->bar(). Here's the one rule to remember and the precedence traps to avoid.
Stop Looping: array_find, array_any and array_all in PHP 8.4
PHP 8.4 adds array_find, array_find_key, array_any and array_all — the readable way to search arrays and retire foreach-with-flag loops.
Deprecate Your Own Code with PHP 8.4's #[\Deprecated] Attribute
PHP 8.4's #[\Deprecated] attribute turns invisible docblock deprecations into real runtime warnings that reflection and static analysis can see. Here's how to use it in a Laravel package.