|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55716 Add an option to pass a custom stream context to get_headers
Submitted: 2011-09-17 17:00 UTC Modified: 2015-10-08 08:46 UTC
Avg. Score:4.3 ± 0.9
Reproduced:23 of 23 (100.0%)
Same Version:6 (26.1%)
Same OS:20 (87.0%)
From: gordon at onlinehome dot de Assigned: tyrael (profile)
Status: Closed Package: Streams related
PHP Version: 5.4.0beta1 OS: any
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.
Block user comment
Status: Assign to:
Bug Type:
From: gordon at onlinehome dot de
New email:
PHP Version: OS:


 [2011-09-17 17:00 UTC] gordon at onlinehome dot de
This get_headers() function uses the default stream context, which can be set/changed with the stream_context_get_default() function. This is sometimes undesirable because the default context will be used for any subsequent uses as well. Please provide an optional third argument to the get_headers() function to allow setting of a custom stream context (just like file_get_contents has). 


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-29 23:12 UTC]
-Assigned To: +Assigned To: tyrael
 [2015-10-08 08:46 UTC]
-Status: Assigned +Status: Closed
 [2015-10-08 08:46 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

fixed it in master, expected to be released in php 7.1.0
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 08 10:05:45 2022 UTC