3v4l.org

run code in 300+ PHP versions simultaneously
<?php $salt ='whatever_you_want'; function simple_encrypt($text) { return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); } function simple_decrypt($text) { return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))); } echo simple_encrypt('9afc6ec6'); echo simple_decrypt('9afc6ec6'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bC024
function name:  (null)
number of ops:  10
compiled vars:  !0 = $salt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'whatever_you_want'
   15     1        INIT_FCALL                                               'simple_encrypt'
          2        SEND_VAL                                                 '9afc6ec6'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   16     5        INIT_FCALL                                               'simple_decrypt'
          6        SEND_VAL                                                 '9afc6ec6'
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
   17     9      > RETURN                                                   1

Function simple_encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bC024
function name:  simple_encrypt
number of ops:  29
compiled vars:  !0 = $text, !1 = $salt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'trim'
          2        INIT_FCALL                                               'base64_encode'
          3        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
          4        FETCH_CONSTANT                                   ~2      'MCRYPT_RIJNDAEL_256'
          5        SEND_VAL_EX                                              ~2
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !0
          8        FETCH_CONSTANT                                   ~3      'MCRYPT_MODE_ECB'
          9        SEND_VAL_EX                                              ~3
         10        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
         11        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
         12        FETCH_CONSTANT                                   ~4      'MCRYPT_RIJNDAEL_256'
         13        SEND_VAL_EX                                              ~4
         14        FETCH_CONSTANT                                   ~5      'MCRYPT_MODE_ECB'
         15        SEND_VAL_EX                                              ~5
         16        DO_FCALL                                      0  $6      
         17        SEND_VAR_NO_REF_EX                                       $6
         18        FETCH_CONSTANT                                   ~7      'MCRYPT_RAND'
         19        SEND_VAL_EX                                              ~7
         20        DO_FCALL                                      0  $8      
         21        SEND_VAR_NO_REF_EX                                       $8
         22        DO_FCALL                                      0  $9      
         23        SEND_VAR                                                 $9
         24        DO_ICALL                                         $10     
         25        SEND_VAR                                                 $10
         26        DO_ICALL                                         $11     
         27      > RETURN                                                   $11
    8    28*     > RETURN                                                   null

End of function simple_encrypt

Function simple_decrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bC024
function name:  simple_decrypt
number of ops:  29
compiled vars:  !0 = $text, !1 = $salt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'trim'
          2        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
          3        FETCH_CONSTANT                                   ~2      'MCRYPT_RIJNDAEL_256'
          4        SEND_VAL_EX                                              ~2
          5        SEND_VAR_EX                                              !1
          6        INIT_FCALL                                               'base64_decode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        SEND_VAR_NO_REF_EX                                       $3
         10        FETCH_CONSTANT                                   ~4      'MCRYPT_MODE_ECB'
         11        SEND_VAL_EX                                              ~4
         12        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
         13        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
         14        FETCH_CONSTANT                                   ~5      'MCRYPT_RIJNDAEL_256'
         15        SEND_VAL_EX                                              ~5
         16        FETCH_CONSTANT                                   ~6      'MCRYPT_MODE_ECB'
         17        SEND_VAL_EX                                              ~6
         18        DO_FCALL                                      0  $7      
         19        SEND_VAR_NO_REF_EX                                       $7
         20        FETCH_CONSTANT                                   ~8      'MCRYPT_RAND'
         21        SEND_VAL_EX                                              ~8
         22        DO_FCALL                                      0  $9      
         23        SEND_VAR_NO_REF_EX                                       $9
         24        DO_FCALL                                      0  $10     
         25        SEND_VAR                                                 $10
         26        DO_ICALL                                         $11     
         27      > RETURN                                                   $11
   13    28*     > RETURN                                                   null

End of function simple_decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
316.37 ms | 1407 KiB | 22 Q