1.2.111. Cant Instantiate Non Class¶
It is not possible to instantiate anything else than a class. Interfaces, enumerations and traits cannot be instantiated.
<?php
class c {}
$object = new c;
trait t {}
new t;
?>
1.2.111.1. Specs¶
Short name |
Classes/CantInstantiateNonClass |
Rulesets |
|
Exakat since |
2.6.2 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |