3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test { private $key; function __construct() { $tmp = fopen("/tmp/foo", "w"); fwrite($tmp, "-----BEGIN RSA PRIVATE KEY----- MIICXQIBAAKBgQDAO3Um1IWsIBORKVLRhiGSkAfbVnAEOOkXRCnuTV521/RA6jAH 1YqzOPIsJK733z9WB4hRsJapoFnxyew8JeBGvxAAvf0BOoJnGqLhtgqLTm8db+hq 2/BDdTnMBycdqjZdzL9uZYudPpzaznHgor/c8xzxsEBQqy1lLBkPxru/IQIDAQAB AoGBAI9rzPwrk4/YXsDvE9s/N80hqLr8wpZj34R8Vsx07QW+GX5VO4Cc0d7lnclR lTlaVubYt9w65C2qdXDwNlCp8amL1iPz4TCqFewwFIzyGoGmwLeLcUxaJ9edBP4W p6jZmk0VcctND3kqFIvNFeEOxQUt2OXK99cPXp9QcictxnwBAkEA4NhUYWXyEtfI XWxp9Qx9yd54fc/QMD2k/D1XEIEZvQBxYyaG33LtwIWC+sERjYU5fC3kCuLzYodi QrDRXgvz9wJBANreSs0mSA8r2AGQnpaQ4Z2u+lO5pwI1tZFMEEuPkVK5ElyI+/g3 0LL2OSif0Ds6iLogiscNcAKrzGHxq3o076cCQQCSAUhB+w5H2CF/MRBZFSR1uuZp ZFIfkVgah8aKrBrHlYsLxI/ed+YVl10nccnxKSrcDXzA6QD84UcYYXODa6WfAkBc 41bPtl2CwtLL5zrHH/oA2BA5lGNC1tSWM7f+uZGtkAow55o4gEe8jC86BIl1eaQp ikIbtKJDH/J/5vclyG2lAkA+Q/DrteU6a3IM0S9nrsxKf321Cp6YoFOGSHG5sXh8 nu+WEYJeKrOGdh1tzsFT9m6khNhMm3g8yFah7WK8pDtu -----END RSA PRIVATE KEY----- "); $this->key = openssl_pkey_get_private("file:///tmp/foo"); } function export() { $exp = null; openssl_pkey_export($this->key, $exp); return $exp; } } $test = new test; echo $test->export();
based on V52Q0
Output for 7.1.20, 7.2.6 - 7.3.0rc4
Fatal error: Uncaught Error: Call to undefined function openssl_pkey_get_private() in /in/7j4pb:22 Stack trace: #0 /in/7j4pb(33): test->__construct() #1 {main} thrown in /in/7j4pb on line 22
Process exited with code 255.
Output for 7.0.20, 7.1.5 - 7.1.10, 7.2.0
Output for 5.4.15 - 5.4.19, 5.4.21 - 7.0.14, 7.1.0
-----BEGIN PRIVATE KEY----- MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMA7dSbUhawgE5Ep UtGGIZKQB9tWcAQ46RdEKe5NXnbX9EDqMAfVirM48iwkrvffP1YHiFGwlqmgWfHJ 7Dwl4Ea/EAC9/QE6gmcaouG2CotObx1v6Grb8EN1OcwHJx2qNl3Mv25li50+nNrO ceCiv9zzHPGwQFCrLWUsGQ/Gu78hAgMBAAECgYEAj2vM/CuTj9hewO8T2z83zSGo uvzClmPfhHxWzHTtBb4ZflU7gJzR3uWdyVGVOVpW5ti33DrkLap1cPA2UKnxqYvW I/PhMKoV7DAUjPIagabAt4txTFon150E/hanqNmaTRVxy00PeSoUi80V4Q7FBS3Y 5cr31w9en1ByJy3GfAECQQDg2FRhZfIS18hdbGn1DH3J3nh9z9AwPaT8PVcQgRm9 AHFjJobfcu3AhYL6wRGNhTl8LeQK4vNih2JCsNFeC/P3AkEA2t5KzSZIDyvYAZCe lpDhna76U7mnAjW1kUwQS4+RUrkSXIj7+DfQsvY5KJ/QOzqIuiCKxw1wAqvMYfGr ejTvpwJBAJIBSEH7DkfYIX8xEFkVJHW65mlkUh+RWBqHxoqsGseViwvEj9535hWX XSdxyfEpKtwNfMDpAPzhRxhhc4NrpZ8CQFzjVs+2XYLC0svnOscf+gDYEDmUY0LW 1JYzt/65ka2QCjDnmjiAR7yMLzoEiXV5pCmKQhu0okMf8n/m9yXIbaUCQD5D8Ou1 5TprcgzRL2euzEp/fbUKnpigU4ZIcbmxeHye75YRgl4qs4Z2HW3OwVP2bqSE2Eyb eDzIVqHtYrykO24= -----END PRIVATE KEY-----
Output for 5.0.0 - 5.4.14, 5.4.20
Fatal error: Call to undefined function openssl_pkey_get_private() in /in/7j4pb on line 22
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/7j4pb on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/7j4pb on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/7j4pb on line 3
Process exited with code 255.