3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $iv = mcrypt_create_iv(16, MCRYPT_DEV_URANDOM); $key = "0123456789123456"; $plain = "id=1"; $res = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plain, "cbc", $iv); $res = base64_encode($iv.$res); $res = base64_decode($res); $iv = substr($res,0, 16); $res = substr($res, 16, strlen($res)-16); $res = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $res, "cbc", $iv); $res = str_replace("\x00", "", $res); parse_str($res, $arr); var_dump($arr);
based on L5eAD
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BEKqi
function name:  (null)
number of ops:  63
compiled vars:  !0 = $iv, !1 = $key, !2 = $plain, !3 = $res, !4 = $arr
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
         1        SEND_VAL_EX                                              16
         2        FETCH_CONSTANT                                   ~5      'MCRYPT_DEV_URANDOM'
         3        SEND_VAL_EX                                              ~5
         4        DO_FCALL                                      0  $6      
         5        ASSIGN                                                   !0, $6
   3     6        ASSIGN                                                   !1, '0123456789123456'
   4     7        ASSIGN                                                   !2, 'id%3D1'
   5     8        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         9        FETCH_CONSTANT                                   ~10     'MCRYPT_RIJNDAEL_128'
        10        SEND_VAL_EX                                              ~10
        11        SEND_VAR_EX                                              !1
        12        SEND_VAR_EX                                              !2
        13        SEND_VAL_EX                                              'cbc'
        14        SEND_VAR_EX                                              !0
        15        DO_FCALL                                      0  $11     
        16        ASSIGN                                                   !3, $11
   6    17        INIT_FCALL                                               'base64_encode'
        18        CONCAT                                           ~13     !0, !3
        19        SEND_VAL                                                 ~13
        20        DO_ICALL                                         $14     
        21        ASSIGN                                                   !3, $14
   8    22        INIT_FCALL                                               'base64_decode'
        23        SEND_VAR                                                 !3
        24        DO_ICALL                                         $16     
        25        ASSIGN                                                   !3, $16
   9    26        INIT_FCALL                                               'substr'
        27        SEND_VAR                                                 !3
        28        SEND_VAL                                                 0
        29        SEND_VAL                                                 16
        30        DO_ICALL                                         $18     
        31        ASSIGN                                                   !0, $18
  10    32        INIT_FCALL                                               'substr'
        33        SEND_VAR                                                 !3
        34        SEND_VAL                                                 16
        35        STRLEN                                           ~20     !3
        36        SUB                                              ~21     ~20, 16
        37        SEND_VAL                                                 ~21
        38        DO_ICALL                                         $22     
        39        ASSIGN                                                   !3, $22
  11    40        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
        41        FETCH_CONSTANT                                   ~24     'MCRYPT_RIJNDAEL_128'
        42        SEND_VAL_EX                                              ~24
        43        SEND_VAR_EX                                              !1
        44        SEND_VAR_EX                                              !3
        45        SEND_VAL_EX                                              'cbc'
        46        SEND_VAR_EX                                              !0
        47        DO_FCALL                                      0  $25     
        48        ASSIGN                                                   !3, $25
  12    49        INIT_FCALL                                               'str_replace'
        50        SEND_VAL                                                 '%00'
        51        SEND_VAL                                                 ''
        52        SEND_VAR                                                 !3
        53        DO_ICALL                                         $27     
        54        ASSIGN                                                   !3, $27
  13    55        INIT_FCALL                                               'parse_str'
        56        SEND_VAR                                                 !3
        57        SEND_REF                                                 !4
        58        DO_ICALL                                                 
  14    59        INIT_FCALL                                               'var_dump'
        60        SEND_VAR                                                 !4
        61        DO_ICALL                                                 
        62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0