3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is a demo, decrypting a string which was encrypted here: https://repl.it/BhjH // CAUTION: This is a 512 bit RSA demo key - NEVER USE THIS SOMEWHERE FOR REAL! $private_key_string = <<<__EOF__ -----BEGIN RSA PRIVATE KEY----- MIIBOwIBAAJBANWj431rbsGw3f6rmED2gN0sKaxxDGvFB/M+o6OwnHGEtz7tL1bz J3wUEHzUkt4EelafK7KHNfOZ45mwmeviPn8CAwEAAQJAYj3oKc+Scf1cSHUuIYl5 fruFOmgN9yz21/ORGn/noQc4HS04VynMhzojs5MVIGTFVW1KTn8L4CdQ9iIHHPO4 SQIhAPkb7XKPrCif9XnJSa8l2roMzBYbUXQeeMHW46OzehGlAiEA24zJgypJ3F8t FLqRwXLH0eMr1D50vbPWcmeAWx5hjlMCIQCtPIa8jL2k4tjLgPgFHcYmbI/hL85N eoNwCgj05vOVIQIgScOUlNgpdrwXhmZkwE0TK8aanDXbvTzl6QwzSOn9NvcCIQCS zYIZywZTRueYk3YQCTX3ofnQad7M9X2802tWqm0q6A== -----END RSA PRIVATE KEY----- __EOF__; $private_key = openssl_pkey_get_private($private_key_string); $encrypted_encoded = "WetPszXfBK3iJgvOh0Wst+j7hBEJbYNGCmR+bgZZNglNsHTBh/ewVS04XpyJUnMTgjvLSoPaCbQ1SIpxJh7eXg=="; $encrypted = base64_decode($encrypted_encoded); openssl_private_decrypt($encrypted, $decrypted, $private_key); echo "decrypted: $decrypted\n";
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Fatal error: Uncaught Error: Call to undefined function openssl_pkey_get_private() in /in/3NKcb:17 Stack trace: #0 {main} thrown in /in/3NKcb on line 17
Process exited with code 255.
Output for 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Fatal error: Call to undefined function openssl_pkey_get_private() in /in/3NKcb on line 17
Process exited with code 255.

preferences:
92.71 ms | 407 KiB | 5 Q