PHP Annotated – January 2024

PHP Annotated Monthly

Welcome to the January edition of PHP Annotated! We’ll recap the most interesting developments in the PHP community over the past month, featuring handpicked news, articles, tools, and videos.

Highlights

  • PHP 8.2.15 and PHP 8.3.2 released

    🐛 These are bug-fix updates.

  • The PHP Foundation Team Update 2024

    This year, four additional developers joined the PHP Foundation team to further foster improvements in PHP and its infrastructure: David Carlier, James Titcumb, Saki Takamachi, and Shivam Mathur.

    Let’s welcome the new team members and wish them great achievements!

  • TIOBE Index for January 2024

    Compared to January 2023, JavaScript climbed to 6th, PHP to 7th, and C# remains 5th but leads in growth in TIOBE Software’s popularity ranking of programming languages.

  • PhpStorm 2024.1 Early Access Program Is Open

    With EAP, you can try upcoming features of PhpStorm and provide your feedback to the PhpStorm team. EAP builds are free to use and do not require a license.

    This build brings support for PHPUnit 11, improvements for the Pest test framework, enhancements to code analysis features, and many other improvements.

PHP Core

  • 📣 RFC: Opt-in DOM spec-compliance

    Proposal to support the “Living Specification” while maintaining backward compatibility, building on the HTML 5 RFC for PHP 8.4.

  • 📣 RFC: Deprecate implicitly nullable parameter types

    Currently, using null as a default value of a function parameter is allowed and does not generate an error even if the parameter has a type declaration and it is not nullable.

    Moreover, there is a slight inconsistency of allowing optional parameters before required once. For example, the following signature is valid:

    Plain text
    Copy to clipboard
    Open code in new window
    EnlighterJS 3 Syntax Highlighter
    function foo(T1 $a, T2 $b = null, T3 $c) {} // Currently valid
    function foo(T1 $a, T2 $b = null, T3 $c) {} // Currently valid
    function foo(T1 $a, T2 $b = null, T3 $c) {} // Currently valid
    

    Máté Kocsis and Gina P. Banyard to deprecate such declarations and require explicit nullable marks. This is a BC break, but the migration is quite straightforward and can be automated.

    Plain text
    Copy to clipboard
    Open code in new window
    EnlighterJS 3 Syntax Highlighter
    function foo(T $var = null) {} // Deprecated warning if RFC accepted
    function foo(?T $var = null) {} // OK
    function foo(T $var = null) {} // Deprecated warning if RFC accepted function foo(?T $var = null) {} // OK
    function foo(T $var = null) {} // Deprecated warning if RFC accepted
    function foo(?T $var = null) {} // OK
    
  • RFC: Improve callbacks in ext/dom and ext/xsl

    PHP 8.4 will bring enhanced callable type support in XSLTProcessor::registerPHPFunctions() and DOMXPath::registerPhpFunctions() methods.

  • RFC: Resource to object conversion

    PHP has a long-term effort to migrate all Resources to Objects. The RFC suggested a plan on how to tackle this transition.

    Primary resources (stream, persistent stream), auxiliary resources (contexts, filters, brigades, buckets), and `Process` resource will be converted in PHP 9.0. Others – in PHP 8.4 or another minor version.

  • 📊 RFC: Final by default anonymous classes

    Daniil Gentili suggests making all anonymous classes final by default and providing a new open keyword to make them non-final if needed.
    This is similar to Kotlin’s new open class {}.

  • 📊 RFC: RFC1867 for non-POST HTTP verbs
    Ilija Tovilo proposes adding a new function, request_parse_body(), to allow handling form data for PUT and PATCH requests.
  • 📊 RFC: Promote the PHP Foundation

    This is a non-technical RFC that originated from a PR for php/web-php to promote the PHP Foundation on the php.net website.

  • RFC: Policy Repository

    Accepted RFC for maintaining PHP development policies in php/policies repository.

  • 📣 RFC: Dedicated StreamBucket class
  • 📣 RFC: Multibyte for ucfirst, lcfirst functions, mb_ucfirst mb_lcfirst
  • 📣RFC: Raising zero to the power of negative number

Tools

Symfony

Laravel

Misc

Conferences


If you have any interesting or useful links to share via PHP Annotated, please leave a comment on this post or send us a tweet.

Subscribe to PHP Annotated


Roman Pronskiy

Developer Advocate at @PhpStorm, Operations Manager at @The PHP Foundation.

Twitter | GitHub

image description