3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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));
based on TZ4Op
Output for 7.0.6 - 7.2.0
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 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.3.19 - 5.3.29, 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.5.34
Notice: Undefined variable: token in /in/4nj5b on line 11 yRrBHse7Ij4TuJxHlSzbnbPDxnm/JILnijGX/Xhug4Ki4LBdpwhLWjpFaReTrzeQfOeLB/o7KmHH4nF9oDntAEFjwCI6QXq0Vs/0FGVLlFuvrQekePMcwWMxAEBybBpe