File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
ext/standard/tests/streams Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 2
2
Test the error cases of stream_context_create()
3
3
--FILE--
4
4
<?php
5
- $ arr = [];
6
5
try {
7
- stream_context_create ($ arr );
6
+ stream_context_create ([ ' ssl ' => " abc " ] );
8
7
} catch (ValueError $ exception ) {
9
8
echo $ exception ->getMessage () . "\n" ;
10
9
}
11
10
12
11
try {
13
- stream_context_create (['ssl ' => ['verify_peer ' => false ]], ["options " => $ arr ]);
12
+ stream_context_create (['ssl ' => ['verify_peer ' => false ]], ["options " => [ ' ssl ' => " abc " ] ]);
14
13
} catch (ValueError $ exception ) {
15
14
echo $ exception ->getMessage () . "\n" ;
16
15
}
17
16
18
17
try {
19
18
stream_context_create (['ssl ' => ['verify_peer ' => false ]], ["options " => false ]);
20
- } catch (ValueError $ exception ) {
19
+ } catch (TypeError $ exception ) {
21
20
echo $ exception ->getMessage () . "\n" ;
22
21
}
23
22
?>
You can’t perform that action at this time.
0 commit comments