1.2.1146. StandaloneType True False Null¶
Report usage of standalone types of true, false and null.
false and null were added to PHP in PHP 8.2, as standalone types : they can be used alone in a type declaration (property, argument or returntype). true was added in PHP 8.3.
<?php
// simplistic example
function foo(true $t) : false {
return false;
}
?>
See also What’s the ‘true’ Standalone Type in PHP?.
1.2.1146.1. Connex PHP features¶
1.2.1146.1.1. Specs¶
Short name |
Typehints/StandaloneTypeTFN |
Rulesets |
|
Exakat since |
2.5.3 |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |