1.2.929. PHP 8.1 New Types¶
This rule reports usage of the new PHP 8.1 type. This is the never type.
This type is only available in return types in methods. This type is not available before version 8.1: as it was not a reserved keyword, it might be used with a class.
<?php
function foo() : never {
die();
}
?>
1.2.929.1. Specs¶
Short name |
Php/Php81NewTypes |
Rulesets |
All, Changed Behavior, CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, CompatibilityPHP70, CompatibilityPHP71, CompatibilityPHP72, CompatibilityPHP73, CompatibilityPHP74, CompatibilityPHP80, CompatibilityPHP81 |
Exakat since |
2.6.6 |
PHP Version |
With PHP 8.1 and older |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |