PHP Annotated – December 2023

PHP Annotated Monthly

Welcome to the December edition of PHP Annotated! In it, we look back over some of the most interesting developments in the PHP community during the past month, featuring handpicked news, articles, tools, and videos.

Highlights

PHP Core

Most of the Core news is covered in detail in the PHP Core Roundup series from the PHP Foundation, so we’ll only include a few brief mentions:

  • 📣 RFC: #[NotSerializable]

    Max Semenik proposes to add a new #[NotSerializable] attribute to prevent the class from serialization. Currently, to achieve similar behavior you need to throw exceptions in __wakeup() and __sleep(). If this RFC is accepted, the code will be cleaner and better lend itself to being analyzed by static analyzers:

    #[NotSerializable]class MyClass
    {
    }
     
    serialize(new MyClass()); // Exception: Serialization of 'MyClass' is not allowed
    
  • 📣 RFC: Policy Repository

    Currently, policies in regard to RFC Voting, the Release Process, security classification, and naming guidelines are all stored in different places.

    Derick Rethans proposes to set up a new Git repository to collect all the policies in one place.

  • ❌📣 RFC: Final anonymous classes

    The RFC was rejected, partly due to the unclear voting question.
    After the feedback, Daniil Gentili proposed a new RFC: Final-by-default anonymous classes.

    He 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 {}. The chances that this proposal will be accepted appear to be quite low.

  • RFC: Change how JIT is disabled by default

    Currently, JIT is disabled when opcache.jit_buffer_size is set to 0. PHP 8.4 will have a separate setting for that with the following default: opcache.jit=disable.

  • PR: new MyClass()->method() without parentheses
    Valentin Udaltsov suggested removing unnecessary parentheses in object initialization expressions, which triggered a heated discussion on X (formerly known as “Twitter”).

  • New PECL is coming in 2024
    The PHP Foundation is about to rework how extensions are installed in PHP.

    Currently, extensions are distributed using the pecl.php.net legacy website and the pecl tool. The goal is to provide a modern alternative that is easier to use for both users and extension maintainers.

Tools

Symfony

Laravel

Other frameworks

Misc

Fun

Conferences

These PHP events are all worth a visit (and feel free to apply as a presenter at any of them as well):


Happy holidays, PHPers! 🎄🐘

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 the @PhpStorm team, Operation Manager at @The PHP Foundation.

Twitter | GitHub

image description