3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bit2chr_mask(string $flags, int $bitmask): string { $chrmask = ''; for($bit = 1, $i = 0; $bit <= $bitmask; $bit <<= 1, $i++) { if($bitmask & $bit){ $chrmask .= $flags[$i]; } } return $chrmask; } var_dump(bit2chr_mask('abcdefghijklmnopqrstuvwxyz1234567890', 2147483648));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9jue5
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'bit2chr_mask'
          2        SEND_VAL                                                 'abcdefghijklmnopqrstuvwxyz1234567890'
          3        SEND_VAL                                                 2147483648
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function bit2chr_mask:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
Branch analysis from position: 10
filename:       /in/9jue5
function name:  bit2chr_mask
number of ops:  18
compiled vars:  !0 = $flags, !1 = $bitmask, !2 = $chrmask, !3 = $bit, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, ''
    6     3        ASSIGN                                                   !3, 1
          4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->12
    8     6    >   BW_AND                                           ~8      !1, !3
          7      > JMPZ                                                     ~8, ->10
    9     8    >   FETCH_DIM_R                                      ~9      !0, !4
          9        ASSIGN_OP                                     8          !2, ~9
    6    10    >   ASSIGN_OP                                     6          !3, 1
         11        PRE_INC                                                  !4
         12    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         13      > JMPNZ                                                    ~13, ->6
   13    14    >   VERIFY_RETURN_TYPE                                       !2
         15      > RETURN                                                   !2
   14    16*       VERIFY_RETURN_TYPE                                       
         17*     > RETURN                                                   null

End of function bit2chr_mask

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.55 ms | 1399 KiB | 16 Q