What's New in PHP 8.1 - Derick Rethans - PHP UK 2022

Php

Discover the latest features and changes in PHP 8.1, including the new "never" type, phasing out of the serializable interface, and more, as presented by Derick Rethans at PHP UK 2022.

Key takeaways
  • PHP 8.1 introduces a new type called the “never” type, which is distinct from “void”, and means that a function will never return.
  • The phasing out of the serializable interface, which is being replaced by the _serialize and _unserialize methods.
  • Type system changes, including the introduction of the “never” type and the phasing out of the serializable interface, and changes to how type declarations work.
  • Enumerations, which are new to PHP 8.1 and can have static methods and can be used as return types.
  • The enum type, which is similar to an integer but with specific values.
  • The list function, which is used to create an array with specific keys and values.
  • Changes to how serialization and unserialization work, including the introduction of the _serialize and _unserialize methods, and the phasing out of the serializable interface.
  • The void return type, which is used to indicate that a function will not return a value.
  • The never return type, which is used to indicate that a function will never return.
  • The static keyword, which is used to indicate that a property or method is part of a class.
  • The _ Fix function, which is used to fix issues with the PHP type system.
  • The Phasing Out of PHP 7.4, which means that support for PHP 7.4 will be ending soon.
  • The DPi (Digital Production Initiative), which is a new feature in PHP 8.1 that allows for the creation of digital products.
  • The PHP-FIG, which is a group of developers who work on the PHP language.
  • The Internals mailing list, which is used to discuss and develop the PHP language.
  • The PHP community, which is a group of developers who work on and use the PHP language.