3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 1010; $pos = 1; var_dump(checkBit($var, $pos)); function checkBit($var, $pos) { return ($var & (1<<$pos)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sYAsp
function name:  (null)
number of ops:  10
compiled vars:  !0 = $var, !1 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1010
    3     1        ASSIGN                                                   !1, 1
    5     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL_BY_NAME                                       'checkBit'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
    9     9      > RETURN                                                   1

Function checkbit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sYAsp
function name:  checkBit
number of ops:  6
compiled vars:  !0 = $var, !1 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        SL                                               ~2      1, !1
          3        BW_AND                                           ~3      !0, ~2
          4      > RETURN                                                   ~3
    9     5*     > RETURN                                                   null

End of function checkbit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.37 ms | 1395 KiB | 15 Q