the part of haystack before or after first occurence of needle. (Johannes)
- Added possibility to check in which extension an internal function was
defined using reflection API. (Johannes)
+- Added second optional parameter to stream_context_create() to set params
+ during context creation. (Sara)
- Fixed bug #36840 (Memory leak if cast operator throws an exception that is
caught). (Dmitry)
- Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
}
/* }}} */
-/* {{{ proto resource stream_context_create([array options])
+/* {{{ proto resource stream_context_create([array options[, array params]])
Create a file context and optionally set parameters */
PHP_FUNCTION(stream_context_create)
{
- zval *params = NULL;
+ zval *options = NULL, *params = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", ¶ms) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &options, ¶ms) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context_alloc();
+ if (options) {
+ parse_context_options(context, options TSRMLS_CC);
+ }
+
if (params) {
- parse_context_options(context, params TSRMLS_CC);
+ parse_context_params(context, params TSRMLS_CC);
}
php_stream_context_to_zval(context, return_value);