3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bitMask = 5; $bitMask = str_split(strrev((string)decbin((int)$bitMask))); $splited = array(); foreach($bitMask as $pos => $bit) { if (0 != $bit) { $splited[] = /* pow(2, $pos); */ (1 << $pos); } } var_dump($splited);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/gT2oe
function name:  (null)
number of ops:  28
compiled vars:  !0 = $bitMask, !1 = $splited, !2 = $bit, !3 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    5     1        INIT_FCALL                                               'str_split'
          2        INIT_FCALL                                               'strrev'
          3        INIT_FCALL                                               'decbin'
          4        CAST                                          4  ~5      !0
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                         $6      
          7        CAST                                          6  ~7      $6
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !0, $9
    7    13        ASSIGN                                                   !1, <array>
    8    14      > FE_RESET_R                                       $12     !0, ->23
         15    > > FE_FETCH_R                                       ~13     $12, !2, ->23
         16    >   ASSIGN                                                   !3, ~13
    9    17        IS_NOT_EQUAL                                             !2, 0
         18      > JMPZ                                                     ~15, ->22
   10    19    >   SL                                               ~17     1, !3
         20        ASSIGN_DIM                                               !1
         21        OP_DATA                                                  ~17
    8    22    > > JMP                                                      ->15
         23    >   FE_FREE                                                  $12
   14    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.7 ms | 941 KiB | 22 Q