1.2.396. 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.396.1. Specs

Short name

Classes/DynamicSelfCalls

Rulesets

All

Exakat since

2.1.1

PHP Version

All

Severity

Time To Fix

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud