1--TEST--
2openssl_pkey_new() error tests
3--SKIPIF--
4<?php if (!extension_loaded("openssl")) print "skip"; ?>
5--FILE--
6<?php
7/* openssl_pkey_get_details() segfaults when getting the information
8    from openssl_pkey_new() with an empty sub-array arg 		*/
9
10$rsa = array("rsa" => array());
11$dsa = array("dsa" => array());
12$dh = array("dh" => array());
13
14try {
15    openssl_pkey_get_details(openssl_pkey_new($rsa));
16} catch (TypeError $e) {
17    echo $e->getMessage(), "\n";
18}
19try {
20    openssl_pkey_get_details(openssl_pkey_new($dsa));
21} catch (TypeError $e) {
22    echo $e->getMessage(), "\n";
23}
24try {
25    openssl_pkey_get_details(openssl_pkey_new($dh));
26} catch (TypeError $e) {
27    echo $e->getMessage(), "\n";
28}
29?>
30--EXPECT--
31openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, bool given
32openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, bool given
33openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, bool given
34