3v4l.org

run code in 300+ PHP versions simultaneously
<?php $msg = 'This is a test'; $key = 'magic_key'; // print, and make unprintable chars available for a link or alike. // using $_GET, php will urldecode it, if it was passed urlencoded print "obfuscated, ready for url: " . urlencode(obfuscate($msg, $key)) . "\n"; print "deObfuscated: " . obfuscate(obfuscate($msg, $key), $key); function obfuscate($msg, $key) { if (empty($key)) return $msg; return $msg ^ str_pad('', strlen($msg), $key); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fYIhU
function name:  (null)
number of ops:  23
compiled vars:  !0 = $msg, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'This+is+a+test'
    3     1        ASSIGN                                                   !1, 'magic_key'
    7     2        INIT_FCALL                                               'urlencode'
          3        INIT_FCALL_BY_NAME                                       'obfuscate'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      'obfuscated%2C+ready+for+url%3A+', $5
         10        CONCAT                                           ~7      ~6, '%0A'
         11        ECHO                                                     ~7
    8    12        INIT_FCALL_BY_NAME                                       'obfuscate'
         13        INIT_FCALL_BY_NAME                                       'obfuscate'
         14        SEND_VAR_EX                                              !0
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR_NO_REF_EX                                       $8
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0  $9      
         20        CONCAT                                           ~10     'deObfuscated%3A+', $9
         21        ECHO                                                     ~10
   15    22      > RETURN                                                   1

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

End of function obfuscate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1396 KiB | 17 Q