PHP 5.3 doesn't allow $this inside anonymous functions

Bug: 73681
Change-Id: Ieffa35247ca84d0615a814eab577c69496f61551