1--TEST-- 2stream_context_set_option() error conditions 3--FILE-- 4<?php 5 6$ctx = stream_context_create(); 7try { 8 stream_context_set_option($ctx, [], "x"); 9} catch (Error $e) { 10 echo $e->getMessage(), "\n"; 11} 12try { 13 stream_context_set_option($ctx, [], null, "x"); 14} catch (Error $e) { 15 echo $e->getMessage(), "\n"; 16} 17try { 18 stream_context_set_option($ctx, "x"); 19} catch (Error $e) { 20 echo $e->getMessage(), "\n"; 21} 22try { 23 stream_context_set_option($ctx, "x", "y"); 24} catch (Error $e) { 25 echo $e->getMessage(), "\n"; 26} 27 28?> 29--EXPECT-- 30stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array 31stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array 32stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string 33stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string 34