| ▲ | ethan_smith 6 hours ago | |
In PHP, closures defined inside a class method automatically capture `$this`, which means the closure holds a reference to the entire object even if it never uses it. This prevents the object from being garbage collected and adds overhead. The optimization detects when `$this` isn't actually used and makes the closure static automatically, dropping that unnecessary reference. | ||