3v4l.org

run code in 300+ PHP versions simultaneously
<?php $env = array( 'token' => 'generickey', 'brand' => 'conversant360', 'macMethod' => 'sha256', 'expire' => '+30 minutes', 'primaryURL' => 'https://new.qualtrics.com/ControlPanel/ssoTest.php?ssotoken=%s', 'secondaryURL' => 'https://new.qualtrics.com/ControlPanel/ssoTest.php?ssotoken=%s', ); $token = $hash = base64_encode( hash_hmac($env['macMethod'], $token, $env['token'], true) ); $token .= '&mac='.$hash; //encrypt the token $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND); echo base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $env['token'], $token, MCRYPT_MODE_ECB,$iv));
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined variable $token in /in/4nj5b on line 11 Deprecated: hash_hmac(): Passing null to parameter #2 ($data) of type string is deprecated in /in/4nj5b on line 11 Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/4nj5b:14 Stack trace: #0 {main} thrown in /in/4nj5b on line 14
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined variable $token in /in/4nj5b on line 11 Deprecated: hash_hmac(): Passing null to parameter #2 ($data) of type string is deprecated in /in/4nj5b on line 11 Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/4nj5b:14 Stack trace: #0 {main} thrown in /in/4nj5b on line 14
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $token in /in/4nj5b on line 11 Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/4nj5b:14 Stack trace: #0 {main} thrown in /in/4nj5b on line 14
Process exited with code 255.
Output for 7.0.6 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: token in /in/4nj5b on line 11 Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/4nj5b:14 Stack trace: #0 {main} thrown in /in/4nj5b on line 14
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/4nj5b:14 Stack trace: #0 {main} thrown in /in/4nj5b on line 14
Process exited with code 255.
Output for 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
Notice: Undefined variable: token in /in/4nj5b on line 11 Warning: mcrypt_encrypt(): Key of size 10 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in /in/4nj5b on line 16
Output for 5.5.35, 5.6.21
Notice: Undefined variable: token in /in/4nj5b on line 11 Fatal error: Call to undefined function mcrypt_get_iv_size() in /in/4nj5b on line 14
Process exited with code 255.
Output for 5.4.9 - 5.4.45, 5.5.24 - 5.5.34
Notice: Undefined variable: token in /in/4nj5b on line 11 yRrBHse7Ij4TuJxHlSzbnbPDxnm/JILnijGX/Xhug4Ki4LBdpwhLWjpFaReTrzeQfOeLB/o7KmHH4nF9oDntAEFjwCI6QXq0Vs/0FGVLlFuvrQekePMcwWMxAEBybBpe

preferences:
219.17 ms | 402 KiB | 248 Q