|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-03 00:12 UTC] bjori@php.net
[2010-01-04 14:54 UTC] cullin dot wible at cullinwible dot com
[2011-07-27 00:14 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 03:00:01 2025 UTC |
Description: ------------ When creating a user stream using the streamWrapper format, the $context variable is NOT set during the stream_open method call. Reproduce code: --------------- class TestStream { public $context; public function __construct() { /* do nothing */ } public function stream_open($path, $mode, $options, &$opened_path) { echo "Open Context: "; var_dump($context); return(true); } } stream_wrapper_register('test, 'TestStream', 0); $options = array( 'test' => array( 'option1' => 'option1_value')); $myContext = stream_context_create($options); fopen('test://test', 'r', false, $myContext); Expected result: ---------------- the $this->context variable should equal $myContext. Actual result: -------------- The $this->context variable is NULL. Please NOTE the following: 1. The $context is set on an fread, however, it should be set during the fopen call. 2. If you look at the PHP-c-code, it appears that the userstream.c class is attempting to set the $context property just after class construction and prior to calling stream_open. Also, after modifying the C-code it appears that the context in the C-code is defined and calls the Zend add_property_resource function. However, there is clearly a bug somewhere as the property is still NULL.