3v4l.org

run code in 300+ PHP versions simultaneously
<?php $word = 'base64_decode'; echo 'bin2hex: ' . PHP_EOL; echo implode(array_map(function($char) { return '\x' . bin2hex($char); }, str_split($word))) . PHP_EOL . PHP_EOL; echo 'unpack: ' . PHP_EOL; echo implode(array_map(function($char) { return '\x' . implode(unpack('H*', $char)); }, str_split($word))) . PHP_EOL . PHP_EOL; echo 'sprintf: ' . PHP_EOL; echo implode(array_map(function($char) { return sprintf('\x%02X', ord($char)); }, (array) str_split($word)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Pc6X
function name:  (null)
number of ops:  46
compiled vars:  !0 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'base64_decode'
    5     1        ECHO                                                     'bin2hex%3A+%0A'
    6     2        INIT_FCALL                                               'implode'
          3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    8     5        SEND_VAL                                                 ~2
          6        INIT_FCALL                                               'str_split'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
    6    10        DO_ICALL                                         $4      
    8    11        SEND_VAR                                                 $4
    6    12        DO_ICALL                                         $5      
    8    13        CONCAT                                           ~6      $5, '%0A'
         14        CONCAT                                           ~7      ~6, '%0A'
         15        ECHO                                                     ~7
   10    16        ECHO                                                     'unpack%3A+%0A'
   11    17        INIT_FCALL                                               'implode'
         18        INIT_FCALL                                               'array_map'
         19        DECLARE_LAMBDA_FUNCTION                          ~8      [1]
   13    20        SEND_VAL                                                 ~8
         21        INIT_FCALL                                               'str_split'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $9      
         24        SEND_VAR                                                 $9
   11    25        DO_ICALL                                         $10     
   13    26        SEND_VAR                                                 $10
   11    27        DO_ICALL                                         $11     
   13    28        CONCAT                                           ~12     $11, '%0A'
         29        CONCAT                                           ~13     ~12, '%0A'
         30        ECHO                                                     ~13
   15    31        ECHO                                                     'sprintf%3A+%0A'
   16    32        INIT_FCALL                                               'implode'
         33        INIT_FCALL                                               'array_map'
         34        DECLARE_LAMBDA_FUNCTION                          ~14     [2]
   18    35        SEND_VAL                                                 ~14
         36        INIT_FCALL                                               'str_split'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                         $15     
         39        CAST                                          7  ~16     $15
         40        SEND_VAL                                                 ~16
   16    41        DO_ICALL                                         $17     
   18    42        SEND_VAR                                                 $17
   16    43        DO_ICALL                                         $18     
   18    44        ECHO                                                     $18
         45      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Pc6X
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'bin2hex'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        CONCAT                                           ~2      '%5Cx', $1
          5      > RETURN                                                   ~2
    8     6*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Pc6X
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'implode'
          2        INIT_FCALL                                               'unpack'
          3        SEND_VAL                                                 'H%2A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        CONCAT                                           ~3      '%5Cx', $2
          9      > RETURN                                                   ~3
   13    10*     > RETURN                                                   null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Pc6X
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%5Cx%2502X'
          3        INIT_FCALL                                               'ord'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
   18     9*     > RETURN                                                   null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.84 ms | 1022 KiB | 20 Q