E0048 reports direct recursion that reuses unchanged arguments and does not reassign the corresponding parameters. These calls are strong candidates for infinite recursion.
$this->sameMethod() with the same parameter variablesself::sameMethod(), static::sameMethod(), or
ClassName::sameMethod() with the same parameter variablesA recursive call is accepted when it changes an argument, for example
countdown($number - 1), or when the function mutates the parameter before the
call. Mutations include direct assignment, ++/--, array element writes,
property writes on parameter objects, unset(), foreach targets, and builtins
that mutate an argument such as array_pop(), array_shift(), sort(), or
preg_match().
Recursion is also accepted when the function mutates object or static state,
calls another method on $this before recursing, or places the recursive call
in a closure that shadows a parameter name. A
fully qualified call such as \getenv() is treated as the global function, not
as a recursive call to a namespaced getenv() function.
E0048 is a local, conservative heuristic:
countdown($number + 0) is treated as
changed, and countdown($number) is treated as unchanged.E0048 has no configuration options and is enabled by default.