php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73425 get_headers() and default GET requests
Submitted: 2016-10-31 05:34 UTC Modified: 2018-03-25 21:23 UTC
Votes:2
Avg. Score:2.5 ± 1.5
Reproduced:0 of 1 (0.0%)
From: spam2 at rhsoft dot net Assigned:
Status: Open Package: Performance problem
PHP Version: 7.0.12 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:

 

 [2016-10-31 05:34 UTC] spam2 at rhsoft dot net
Description:
------------
"By default get_headers uses a GET request" is not common sense especially when you can only change that with stream_context_set_default() other than file_get_contents which has a context param

what's the point of that insane default while no server refuses HEAD requests which are logical here by the functions name and behavior - even a httpd with <Limit GET POST> won't refuse HEAD-requests, ours are configzred that way

and no, please don't come with identical behavior and using stream wrappers for everything, when soemone wants to do that he can just achieve the same with file_get_contents which has in fact even a sane context param

what someone expects froma function called get_headers() is, well, just fetch the headers and not the body which is thrown away and if one implements such a unexpetable default it's not enough that you need to *scroll down* in teh documentation to find that out - common sense and least surprise


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-25 16:59 UTC] cmb@php.net
FWIW, as of PHP 7.1.0, get_headers() supports an optional $context
argument.
 [2018-03-25 17:13 UTC] spam2 at rhsoft dot net
cool, thanks

whoever is adapting the manual shoul also think about the other languages and *at least* adopt the params and types on top (it's not the only function which is lacking basic infos like params over time and even wrong types are in general only fixed for the english version)

http://php.net/manual/en/function.get-headers.php
http://php.net/manual/de/function.get-headers.php
 [2018-03-25 21:23 UTC] cmb@php.net
> it's not the only function which is lacking basic infos like
> params over time and even wrong types are in general only fixed
> for the english version

Well, the English docs are the reference, so they are written,
fixed and updated first.  The respective translation teams are
supposed to "sync with EN" as soon as time permits.  It would be
good if the translations pointed out whether they are outdated,
but unfortunately PhD does not support that yet.  Anyhow, many
translations could need some help (the German translation
certainly does!), so consider to submit patches via
<https://edit.php.net/>.

FTR: the $context parameter has been documented[1], and the German
translation has been synced[2].

[1] <http://svn.php.net/viewvc?view=revision&revision=344567>
[2] <http://svn.php.net/viewvc?view=revision&revision=344568>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Oct 19 10:01:26 2019 UTC