HHVM: call ->last on the environments instead of end()