1--TEST-- 2stream_context_set_option() function - basic test for stream_context_set_option() 3--CREDITS-- 4Jean-Marc Fontaine <jean-marc.fontaine@alterway.fr> 5# Alter Way Contribution Day 2011 6--FILE-- 7<?php 8$context = stream_context_create(); 9 10// Single option 11var_dump(stream_context_set_option($context, 'http', 'method', 'POST')); 12 13// Array of options 14$options = array( 15 'http' => array( 16 'protocol_version' => 1.1, 17 'user_agent' => 'PHPT Agent', 18 ), 19); 20var_dump(stream_context_set_option($context, $options)); 21 22var_dump(stream_context_get_options($context)); 23?> 24--EXPECTF-- 25bool(true) 26 27Deprecated: Calling stream_context_set_option() with 2 arguments is deprecated, use stream_context_set_options() instead in %s on line %d 28bool(true) 29array(1) { 30 ["http"]=> 31 array(3) { 32 ["method"]=> 33 string(4) "POST" 34 ["protocol_version"]=> 35 float(1.1) 36 ["user_agent"]=> 37 string(10) "PHPT Agent" 38 } 39} 40