3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Create the keypair $res=openssl_pkey_new(); // Get private key openssl_pkey_export($res, $privkey); // Get public key $pubkey=openssl_pkey_get_details($res); $pubkey=$pubkey["key"];
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: openssl_pkey_export(): cannot get key from parameter 1 in /in/oZO15 on line 6 Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in /in/oZO15 on line 9
Output for 5.4.15 - 7.0.6, 7.1.0
Output for 5.3.18 - 5.4.14
Fatal error: Call to undefined function openssl_pkey_new() in /in/oZO15 on line 3
Process exited with code 255.