[英]What is the benefit of using getallheaders() instead of apache_request_headers()?
When using Rector as an aid in upgrading php versions from 7.2 to 7.3, one rule (RenameFunctionRector) changes all instances of apache_request_headers()
to getallheaders()
.当使用 Rector 帮助将 php 版本从 7.2 升级到 7.3 时,一条规则 (RenameFunctionRector) 将
apache_request_headers()
的所有实例更改为getallheaders()
。
After reading the documentation for both functions, it appears that getallheaders()
is an alias and there's no difference between the two as far as I can see.在阅读了这两个函数的文档后,
getallheaders()
似乎是一个别名,据我所知,两者之间没有区别。 Can anyone explain the reason why getallheaders()
exists and if there's any benefit to implementing it?谁能解释
getallheaders()
存在的原因以及实施它是否有任何好处?
apache_request_headers
was flagged for possible deprecation in 7.4 . apache_request_headers
被标记为可能在 7.4 中弃用。 Although that didn't happen, I think it was added to Rector just in case it did happen eventually.虽然那没有发生,但我认为它被添加到 Rector以防万一它最终发生了。
As for why it was flagged for deprecation, this thread talks about it, but basically that function's name implies it is Apache-specific, however there are other SAPIs besides that.至于为什么它被标记为弃用,这个线程讨论它,但基本上该函数的名称暗示它是特定于 Apache 的,但是除此之外还有其他 SAPI。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.