1.2.1138. 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.1138.1. Specs

Short name

Typehints/StandaloneTypeTFN

Rulesets

All, Analyze, Changed Behavior

Exakat since

2.5.3

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

High

Features

type

Available in

Entreprise Edition, Exakat Cloud