symfony / polyfill

PHP polyfills

Home Page:https://symfony.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polyfill PHP 7.3+ getallheaders()

Krinkle opened this issue · comments

If there is agreement to accept a polyfill for this, I'd be interested to help and write the patch for it. My first question would be to know whether it's preferred to re-use ralouphie/getallheaders by dependency, or whether to embed it (effectively a fork).

The issue is that it's not possible to polyfill correctly this function. The linked package works in some specific situations, but it's impossible to have a polyfill that works in every situations. That's why we didn't add this function here. Use ralouphie/getallheaders if it's ok for you.

@nicolas-grekas What aspect of getallheaders() is impossible to polyfill?

I'm going to close here because ralouphie/getallheaders is fine for ppl that want this, and also because using this function should be discouraged. It uses global state and the fact that it's not available on all SAPIs is because it doesn't make sense on the unsupported SAPIs. Adding a polyfill for something that doesn't make sense... doesn't make sense here :)