fix PHP 5.3 issue ($this scope)

fixes #212