55--FILE--
66<?php
77
8+ class A {}
9+ $ fp = fopen ('php://memory ' , 'r ' );
10+
811try {
9- deflate_init (ZLIB_ENCODING_DEFLATE , ['level ' => [] ]);
12+ deflate_init (ZLIB_ENCODING_DEFLATE , ['level ' => ' foo ' ]);
1013} catch (TypeError $ e ) {
1114 echo $ e ->getMessage (), PHP_EOL ;
1215}
@@ -18,20 +21,22 @@ try {
1821}
1922
2023try {
21- deflate_init (ZLIB_ENCODING_DEFLATE , ['window ' => [] ]);
24+ deflate_init (ZLIB_ENCODING_DEFLATE , ['window ' => new A () ]);
2225} catch (TypeError $ e ) {
2326 echo $ e ->getMessage (), PHP_EOL ;
2427}
2528
2629try {
27- deflate_init (ZLIB_ENCODING_DEFLATE , ['strategy ' => [] ]);
30+ deflate_init (ZLIB_ENCODING_DEFLATE , ['strategy ' => $ fp ]);
2831} catch (TypeError $ e ) {
2932 echo $ e ->getMessage (), PHP_EOL ;
3033}
3134
35+ fclose ($ fp );
36+
3237?>
3338--EXPECT--
34- deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, array given
39+ deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, string given
3540deflate_init(): Argument #2 ($options) the value for option "memory" must be of type int, array given
36- deflate_init(): Argument #2 ($options) the value for option "window" must be of type int, array given
37- deflate_init(): Argument #2 ($options) the value for option "strategy" must be of type int, array given
41+ deflate_init(): Argument #2 ($options) the value for option "window" must be of type int, A given
42+ deflate_init(): Argument #2 ($options) the value for option "strategy" must be of type int, resource given
0 commit comments