1.2.717. 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.717.1. Connex PHP features

1.2.717.1.1. Specs

Short name

Php/MixedUsage

Rulesets

All, Appinfo, Changed Behavior

Exakat since

2.3.0

PHP Version

With PHP 8.1 and more recent

Severity

Time To Fix

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud