use php 5.4 closures see #3687

See #3687