fix for $this in anonymous function

this feature is only available in php  >= 5.4