3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encode($message, $seed) { return base64_encode($message.$seed); } function decode($data, $seed) { return substr(base64_decode($data), 0, strlen($seed)*-1); } var_dump($data = encode('hi this is a string','seed123'), decode($data, 'seed123'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hm5TA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'encode'
          2        SEND_VAL                                                 'hi+this+is+a+string'
          3        SEND_VAL                                                 'seed123'
          4        DO_FCALL                                      0  $1      
          5        ASSIGN                                           ~2      !0, $1
          6        SEND_VAL                                                 ~2
          7        INIT_FCALL                                               'decode'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'seed123'
         10        DO_FCALL                                      0  $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hm5TA
function name:  encode
number of ops:  8
compiled vars:  !0 = $message, !1 = $seed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'base64_encode'
          3        CONCAT                                           ~2      !0, !1
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
          7*     > RETURN                                                   null

End of function encode

Function decode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hm5TA
function name:  decode
number of ops:  14
compiled vars:  !0 = $data, !1 = $seed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'substr'
          3        INIT_FCALL                                               'base64_decode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        SEND_VAL                                                 0
          8        STRLEN                                           ~3      !1
          9        MUL                                              ~4      ~3, -1
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                         $5      
         12      > RETURN                                                   $5
         13*     > RETURN                                                   null

End of function decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.83 ms | 1403 KiB | 23 Q