3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_url_safe_characters = array ( '-', '_', '', ); $_not_url_safe_characters = array ( '+', '/', '=', ); /* Data */ $key = 'this is a very long key, even too long for the cipher'; $encrypted_price = '-cMgOXQks'; $key = '123456789012345678901234'; $str_iv = 'genieeee'; $encrypted_price = str_replace ( $_url_safe_characters, $_not_url_safe_characters, $encrypted_price ); echo 'encrypted_price = '. $encrypted_price, ','; $encrypted_price = base64_decode ( $encrypted_price ); echo 'decodebase64 = '. $encrypted_price, ','; /* Open module, and create IV */ $td = mcrypt_module_open('des', '', 'cfb', ''); /* Initialize encryption handle */ if (mcrypt_generic_init($td, $key, $str_iv) != -1) { /* Encrypt data */ $decrypted_price = mdecrypt_generic($td, $encrypted_price); /* Clean up */ mcrypt_generic_deinit($td); mcrypt_module_close($td); } echo 'decrypted_price = '. floatval($decrypted_price); ?>
Output for 7.0.6 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
encrypted_price = +cMgOXQks,decodebase64 = �� 9t$, Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /in/pcbjr:26 Stack trace: #0 {main} thrown in /in/pcbjr on line 26
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.34, 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
encrypted_price = +cMgOXQks,decodebase64 = �� 9t$, Warning: mcrypt_generic_init(): Key size too large; supplied length: 24, max: 8 in /in/pcbjr on line 29 decrypted_price = 0
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
encrypted_price = +cMgOXQks,decodebase64 = �� 9t$, Fatal error: Call to undefined function mcrypt_module_open() in /in/pcbjr on line 26
Process exited with code 255.
Output for 4.4.5 - 4.4.9
encrypted_price = +cMgOXQks,decodebase64 = �� 9t$, Fatal error: Call to undefined function: mcrypt_module_open() in /in/pcbjr on line 26
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
encrypted_price = +cMgOXQks,decodebase64 = �� 9t$, Fatal error: Call to undefined function: mcrypt_module_open() in /in/pcbjr on line 26
Process exited with code 255.
Output for 4.3.0 - 4.3.1
encrypted_price = +cMgOXQks,decodebase64 = �� 9t$, Fatal error: Call to undefined function: mcrypt_module_open() in /in/pcbjr on line 26

preferences:
224.14 ms | 401 KiB | 325 Q