PHP 8.0
https://www.php.net/releases/8.0/en.php
It contains many new features and optimizations including named arguments, union types, attributes, constructor property promotion, match expression, nullsafe operator, JIT, and improvements in the type system, error handling, and consistency.
- Named Arguments: You can now specify only required parameters, skipping optional ones. Arguments are order-independent and self-documented.
- Attributes: Instead of PHPDoc annotations, you can use structured metadata with PHP’s native syntax.
- Constructor Property Promotion: Less boilerplate code to define and initialize properties in classes.
- Union Types: Native union type declarations allow validation at runtime for combinations of types.
- Match Expression: Similar to switch, but with additional features like being an expression and strict comparisons.
- Nullsafe Operator: Simplifies null checks in chains of calls.
- Saner String to Number Comparisons: PHP 8 uses number comparison when comparing to numeric strings.
- Consistent Type Errors for Internal Functions: Improved consistency in type errors.
Performance improvements in PHP 8
Just-In-Time (JIT) Compilation: PHP 8 includes two JIT compilation engines: Tracing JIT and Function JIT. While typical application performance remains similar to PHP 7.4, CPU-intensive applications benefit significantly from JIT compilation.
Zend Engine 3.0: The updated engine and improved memory usage contribute to better overall performance.
Faster Execution Times: PHP 8’s enhancements result in faster execution, leading to smoother user experiences and reduced server costs.
PHP 8.1
https://www.php.net/releases/8.1/en.php
https://php.watch/versions/8.1
https://php.watch/versions/8.1/releases
PHP 8.1 is currently only receiving security fixes only. It is highly recommended to update to a recent PHP version, as PHP 8.1 is scheduled to reach End-of-Life on 2025-12-31
PHP 8.1 brings several exciting features and enhancements
Enums: Finally, PHP supports enumerations (enums). You can use them instead of a set of constants, and they provide built-in validation
Readonly Properties: You can now define properties as readonly, preventing changes after initialization. Great for modeling value objects and data-transfer objects
First-class Callable Syntax: Get references to any function using this syntax. Useful for dynamic function calls.
Pure Intersection Types: Use when a value needs to satisfy multiple type constraints simultaneously.
Never Return Type: Indicates that a function never returns (e.g., exit or throw an exception)
PHP 8.2
https://www.php.net/releases/8.2/en.php
It contains many new features, including readonly classes, null, false, and true as stand-alone types, deprecated dynamic properties, performance improvements and more.
PHP 8.3
https://www.php.net/releases/8.3/en.php
It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.
PHP 8.4 Incoming...