3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = /*16777215 - */302; $a = myencrypt($val); echo 'a: '. $a . '<br/>'; echo mydecrypt($a) . ' should equal ' . $val; $b = myencrypt($val+1); echo 'b: '. $b . '<br/>'; echo mydecrypt($b) . ' should equal ' . $val+1; function myencrypt($data){ $data = base_convert($data, 10, 36); //$data = str_pad($data, 8, '0', STR_PAD_LEFT); $data = openssl_encrypt( $data, 'aes-128-ctr', 'key', 0, openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-128-ctr')) ); $data = str_replace('=', '', base64_encode($data)); return $data; } function mydecrypt($data) { if ($base64_safe) $data = base64_decode($data.'=='); $data = openssl_decrypt( $data, 'aes-128-ctr', 'key', 0, $iv); $data = base_convert($data, 36, 10); return $data; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/0YPJm:17 Stack trace: #0 /in/0YPJm(4): myencrypt('8e') #1 {main} thrown in /in/0YPJm on line 17
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:
58.3 ms | 401 KiB | 8 Q