3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = '057e6752d585a7a94894dff65ab2537e'; $key = hash('sha256', $key, true); function encrypt($value) { $encryption_key = base64_decode($key); $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc')); $encrypted = openssl_encrypt($value, 'aes-256-cbc', $encryption_key, 0, $iv); return base64_encode($encrypted . '::' . $iv); } function decrypt($value) { $encryption_key = base64_decode($key); list($encrypted_data, $iv) = explode('::', base64_decode($value), 2); return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key, 0, $iv); } $criptando = encrypt('1038'); echo 'criptando : ' . $criptando . '<br>'; echo 'decriptando: ' . decrypt($criptando);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $key in /in/l3asq on line 6 Deprecated: base64_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/l3asq on line 6 Fatal error: Uncaught Error: Call to undefined function openssl_random_pseudo_bytes() in /in/l3asq:7 Stack trace: #0 /in/l3asq(18): encrypt('1038') #1 {main} thrown in /in/l3asq on line 7
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:
162.84 ms | 406 KiB | 5 Q