3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bytesToBits(string $bytestring) : string { $tmp = strlen($bytestring); if ($tmp % 4) { $bytestring = str_pad($bytestring, intdiv($tmp, 4) * 4 + 4, '0', STR_PAD_LEFT); } $tmp = ''; foreach (str_split($bytestring, 4) as $chunk) { $tmp .= str_pad(base_convert(unpack('H*', $chunk)[1], 16, 2), 32, '0', STR_PAD_LEFT); } return $tmp; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b1J0R
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   1

Function bytestobits:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 43
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 43
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 18
filename:       /in/b1J0R
function name:  bytesToBits
number of ops:  48
compiled vars:  !0 = $bytestring, !1 = $tmp, !2 = $chunk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        STRLEN                                           ~3      !0
          2        ASSIGN                                                   !1, ~3
    5     3        MOD                                              ~5      !1, 4
          4      > JMPZ                                                     ~5, ->18
    6     5    >   INIT_FCALL                                               'str_pad'
          6        SEND_VAR                                                 !0
          7        INIT_FCALL                                               'intdiv'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 4
         10        DO_ICALL                                         $6      
         11        MUL                                              ~7      $6, 4
         12        ADD                                              ~8      ~7, 4
         13        SEND_VAL                                                 ~8
         14        SEND_VAL                                                 '0'
         15        SEND_VAL                                                 0
         16        DO_ICALL                                         $9      
         17        ASSIGN                                                   !0, $9
    8    18    >   ASSIGN                                                   !1, ''
    9    19        INIT_FCALL                                               'str_split'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 4
         22        DO_ICALL                                         $12     
         23      > FE_RESET_R                                       $13     $12, ->43
         24    > > FE_FETCH_R                                               $13, !2, ->43
   10    25    >   INIT_FCALL                                               'str_pad'
         26        INIT_FCALL                                               'base_convert'
         27        INIT_FCALL                                               'unpack'
         28        SEND_VAL                                                 'H%2A'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $14     
         31        FETCH_DIM_R                                      ~15     $14, 1
         32        SEND_VAL                                                 ~15
         33        SEND_VAL                                                 16
         34        SEND_VAL                                                 2
         35        DO_ICALL                                         $16     
         36        SEND_VAR                                                 $16
         37        SEND_VAL                                                 32
         38        SEND_VAL                                                 '0'
         39        SEND_VAL                                                 0
         40        DO_ICALL                                         $17     
         41        ASSIGN_OP                                     8          !1, $17
    9    42      > JMP                                                      ->24
         43    >   FE_FREE                                                  $13
   12    44        VERIFY_RETURN_TYPE                                       !1
         45      > RETURN                                                   !1
   13    46*       VERIFY_RETURN_TYPE                                       
         47*     > RETURN                                                   null

End of function bytestobits

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.87 ms | 1400 KiB | 23 Q