1--TEST--
2openssl_pkcs7_decrypt() and invalid parameters
3--SKIPIF--
4<?php if (!extension_loaded("openssl")) print "skip"; ?>
5--FILE--
6<?php
7
8function myErrorHandler($errno, $errstr, $errfile, $errline) {
9    var_dump($errstr);
10}
11set_error_handler("myErrorHandler");
12
13$a = 1;
14$b = 1;
15$c = new stdclass;
16$d = new stdclass;
17
18var_dump(openssl_pkcs7_decrypt($a, $b, $c, $d));
19var_dump($c);
20
21var_dump(openssl_pkcs7_decrypt($b, $b, $b, $b));
22var_dump(openssl_pkcs7_decrypt($a, $b, "", ""));
23var_dump(openssl_pkcs7_decrypt($a, $b, true, false));
24var_dump(openssl_pkcs7_decrypt($a, $b, 0, 0));
25
26echo "Done\n";
27?>
28--EXPECTF--
29string(57) "Object of class stdClass could not be converted to string"
30string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
31bool(false)
32object(stdClass)#1 (0) {
33}
34string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
35bool(false)
36string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
37bool(false)
38string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
39bool(false)
40string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
41bool(false)
42Done
43