Avoid using static scope within closure - php 5.3 pita problems