3v4l.org

run code in 300+ PHP versions simultaneously
<?php function aesCtr(string $m, string $n, string $k): string { return \openssl_decrypt($m, 'aes-128-ctr', $k, OPENSSL_RAW_DATA, $n); } $messages = [ 'wGVEtlgIETc4E4SNly0b7viJAv3bpO/85lC5/XCssVnMlrPc+TxeI+Jrsl+wVwQVOKbCEw8=', '2GxE9VRBC3giH5XMiSQXvfnGAeGHBqlXABl1mHrcabUCi8PLNlZCe+K1+3M9Vvb9nJo0AjHjuYkARV9h8WRywgFg+VSWKLb0K0lg+ZBVN70sJ+GRLrB6mCUK/ZeYucA=', '1mgX9w0TFzd2Ty69vfYaKmioBx7KaZoHHuCYCOEG519T2EQs6HJMIIle' ]; $key = hash('sha256', 'spottycats', true); var_dump(bin2hex($key)); $nonce = str_repeat("\x00", 16); // First, remove the base64 decoding: $base64decoded = [ base64_decode($messages[0]), base64_decode($messages[1]), base64_decode($messages[2]) ]; // The last 32 bytes are a HMAC. We can strip that. $stripLast32 = [ mb_substr($base64decoded[0], 0, -32, '8bit'), mb_substr($base64decoded[1], 0, -32, '8bit'), mb_substr($base64decoded[2], 0, -32, '8bit') ]; var_dump( bin2hex($stripLast32[0]), bin2hex($stripLast32[1]), bin2hex($stripLast32[2]), aesCtr($messages[0], $nonce, $key), aesCtr($messages[1], $nonce, $key), aesCtr($messages[2], $nonce, $key) );
Output for git.master, git.master_jit, rfc.property-hooks
string(64) "27ba61131ac180b9c03e439dd81bc536f63b30b6009000688292f17cc086da61" Fatal error: Uncaught Error: Call to undefined function openssl_decrypt() in /in/siB90:4 Stack trace: #0 /in/siB90(35): aesCtr('wGVEtlgIETc4E4S...', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...', ''\xBAa\x13\x1A\xC1\x80\xB9\xC0>C\x9D\xD8\e\xC5...') #1 {main} thrown in /in/siB90 on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.67 ms | 401 KiB | 8 Q