1.2.713. Mixed Typehint Usage

Usage of the mixed typehint.

<?php

function foo() : mixed {
    switch(rand(0, 3)) {
        case 0:
            return false;

        case 1:
            return 'a';

        case 2:
            return [];

        default:
            return null;
    }
}

?>

See also Type declarations.

1.2.713.1. Specs

Short name

Php/MixedUsage

Rulesets

All, Appinfo

Exakat since

2.3.0

PHP Version

With PHP 8.1 and more recent

Severity

Time To Fix

Precision

Very high

Features

mixed

Available in

Entreprise Edition, Exakat Cloud