1--TEST-- 2stream_context_get_params() 3--FILE-- 4<?php 5 6$ctx = stream_context_create(); 7var_dump($ctx); 8var_dump(stream_context_get_params($ctx)); 9 10var_dump(stream_context_set_option($ctx, "foo","bar","baz")); 11var_dump(stream_context_get_params($ctx)); 12 13var_dump(stream_context_set_params($ctx, array("notification" => "stream_notification_callback"))); 14var_dump(stream_context_get_params($ctx)); 15 16var_dump(stream_context_set_params($ctx, array("notification" => array("stream","notification_callback")))); 17var_dump(stream_context_get_params($ctx)); 18 19var_dump(stream_context_get_params($ctx)); 20var_dump(stream_context_get_options($ctx)); 21var_dump(stream_context_get_params($ctx)); 22var_dump(stream_context_get_options($ctx)); 23 24?> 25--EXPECTF-- 26resource(%d) of type (stream-context) 27array(1) { 28 ["options"]=> 29 array(0) { 30 } 31} 32bool(true) 33array(1) { 34 ["options"]=> 35 array(1) { 36 ["foo"]=> 37 array(1) { 38 ["bar"]=> 39 string(3) "baz" 40 } 41 } 42} 43bool(true) 44array(2) { 45 ["notification"]=> 46 string(28) "stream_notification_callback" 47 ["options"]=> 48 array(1) { 49 ["foo"]=> 50 array(1) { 51 ["bar"]=> 52 string(3) "baz" 53 } 54 } 55} 56bool(true) 57array(2) { 58 ["notification"]=> 59 array(2) { 60 [0]=> 61 string(6) "stream" 62 [1]=> 63 string(21) "notification_callback" 64 } 65 ["options"]=> 66 array(1) { 67 ["foo"]=> 68 array(1) { 69 ["bar"]=> 70 string(3) "baz" 71 } 72 } 73} 74array(2) { 75 ["notification"]=> 76 array(2) { 77 [0]=> 78 string(6) "stream" 79 [1]=> 80 string(21) "notification_callback" 81 } 82 ["options"]=> 83 array(1) { 84 ["foo"]=> 85 array(1) { 86 ["bar"]=> 87 string(3) "baz" 88 } 89 } 90} 91array(1) { 92 ["foo"]=> 93 array(1) { 94 ["bar"]=> 95 string(3) "baz" 96 } 97} 98array(2) { 99 ["notification"]=> 100 array(2) { 101 [0]=> 102 string(6) "stream" 103 [1]=> 104 string(21) "notification_callback" 105 } 106 ["options"]=> 107 array(1) { 108 ["foo"]=> 109 array(1) { 110 ["bar"]=> 111 string(3) "baz" 112 } 113 } 114} 115array(1) { 116 ["foo"]=> 117 array(1) { 118 ["bar"]=> 119 string(3) "baz" 120 } 121} 122