1.2.1195. The Mixed Keyword¶
mixed has becomes a PHP keyword. It is used for explicitly typing methods, argument or properties which accept any type of data.
That name should be avoided in classes, traits, enumerations and interfaces. Methods, anonymous classes (sic), namespaces and functions are OK to use it.
<?php
// This is OK
function mixed() { }
// This is not possible anymore in PHP 8.0.
class mixed { }
?>
See also mixed.
1.2.1195.2. Connex PHP features¶
1.2.1195.2.1. Suggestions¶
Rename the classes, traits and interfaces with a different name.
1.2.1195.2.2. Specs¶
Short name |
Php/MixedKeyword |
Rulesets |
All, Changed Behavior, CompatibilityPHP80, CompatibilityPHP81 |
Exakat since |
2.3.0 |
PHP Version |
With PHP 8.0 and older |
Severity |
Major |
Time To Fix |
Slow (1 hour) |
Precision |
Very high |
Available in |