3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decodeSecret($secret) { return base64_decode(strrev(hex2bin($secret))); } function encodeSecret($secret) { return bin2hex(strrev(base64_encode($secret))); } //$secret = "3d3d516343746d4d6d6c315669563362"; echo base64_decode(strrev(hex2bin('3d3d516343746d4d6d6c315669563362'))); //echo $s2 = base64_decode($secret); //echo $s3 = strrev($s2); //echo hex2bin($s3); echo "\n----------\n"; echo encodeSecret("TEST");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s76ig
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'base64_decode'
          1        INIT_FCALL                                               'strrev'
          2        INIT_FCALL                                               'hex2bin'
          3        SEND_VAL                                                 '3d3d516343746d4d6d6c315669563362'
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9        ECHO                                                     $2
   15    10        ECHO                                                     '%0A----------%0A'
   16    11        INIT_FCALL                                               'encodesecret'
         12        SEND_VAL                                                 'TEST'
         13        DO_FCALL                                      0  $3      
         14        ECHO                                                     $3
         15      > RETURN                                                   1

Function decodesecret:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s76ig
function name:  decodeSecret
number of ops:  12
compiled vars:  !0 = $secret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'base64_decode'
          2        INIT_FCALL                                               'strrev'
          3        INIT_FCALL                                               'hex2bin'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
    4    11*     > RETURN                                                   null

End of function decodesecret

Function encodesecret:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s76ig
function name:  encodeSecret
number of ops:  12
compiled vars:  !0 = $secret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'bin2hex'
          2        INIT_FCALL                                               'strrev'
          3        INIT_FCALL                                               'base64_encode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
    8    11*     > RETURN                                                   null

End of function encodesecret

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.98 ms | 1418 KiB | 24 Q