1.2.400. Dynamic Self Calls¶
A class that calls itself dynamically. This may be property or methods.
Calling itself dynamically happens when a class is configured to call various properties (container) or methods. This rule is mostly useful internally, to side some special situations.
<?php
class x {
function foo() {
$f = 'goo';
return $this->$f();
}
function goo() {
return rand(1, 10);
}
}
?>
1.2.400.1. Specs¶
Short name |
Classes/DynamicSelfCalls |
Rulesets |
|
Exakat since |
2.1.1 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |