Getallheaders fpm

Following up on #523 , fixed the comments by refactoring and fixing the trailing character.

Reminder: fixes https://bugs.php.net/bug.php?id=62596