|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38654 stream functions seem not affected by stream_context_create()
Submitted: 2006-08-30 10:48 UTC Modified: 2006-09-01 12:58 UTC
From: tjerk dot meesters at gmail dot com Assigned:
Status: Closed Package: Streams related
PHP Version: 5.1.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
32 - 30 = ?
Subscribe to this entry?

 [2006-08-30 10:48 UTC] tjerk dot meesters at gmail dot com
When file_get_contents() is used in combination with stream_context_create() not all wrapper options are taken into consideration.

Tested PHP versions on Linux:
5.1.5 - not working
5.1.1 - working
5.0.4 - working

This bug doesn't seems to appear on Windows platforms:
5.1.5 - working

Reproduce code:

// this code will perform a POST request to a URL with this code:
// print_r($_POST)

echo file_get_contents("",null,stream_context_create(array(
        'http' => array(
                'method' => 'POST',
                'content' => 'cmd=_notify-validate',
                'header' => 'Content-Type: application/x-www-form-urlencoded',


Expected result:
    [cmd] => _notify-validate

The meta information:
CONTENT_TYPE: application/x-www-form-urlencoded

Actual result:

The meta information:
HTTP_USER_AGENT: PHP/5.1.5 <-- this didnt't appear anywhere else
CONTENT_TYPE: application/x-www-form-urlencoded


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-30 11:00 UTC]
Please try using this CVS snapshot:
For Windows:

Can't reproduce with both 5.1.5 and 5.2-CVS.
 [2006-08-30 15:05 UTC] tjerk dot meesters at gmail dot com
updated summary ...
 [2006-08-30 15:17 UTC]
Still not reproducible.
 [2006-08-31 11:50 UTC] tjerk dot meesters at gmail dot com
Bug still present in 5.1.6, but it seems to be resolved in 5.2.0RC3-dev
 [2006-09-01 12:58 UTC]
5.2.0 is the next release.
Fixed -> closed.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 01:01:32 2024 UTC