The changelog about anonymous function says:

5.4.0	$this can be used in anonymous functions.
5.3.0	 Anonymous functions become available.

Wanted to be 5.3 compatible.