Lambdas not (indirectly) referencing $this
must be declared static
.
Risky when using ->bindTo
on lambdas without referencing to $this
.
--- Original
+++ New
<?php
-$a = function () use ($b)
+$a = static function () use ($b)
{ echo $b;
};
The rule is part of the following rule set: