3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = 12; $bin_val = 1 << ($val -1); var_dump($bin_val); var_dump(pow(2, $val - 1)); $val = 1 >> ($val - 1); var_dump($val);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J855g
function name:  (null)
number of ops:  22
compiled vars:  !0 = $val, !1 = $bin_val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 12
    6     1        SUB                                              ~3      !0, 1
          2        SL                                               ~4      1, ~3
          3        ASSIGN                                                   !1, ~4
    8     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
    9     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'pow'
          9        SEND_VAL                                                 2
         10        SUB                                              ~7      !0, 1
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
   12    15        SUB                                              ~10     !0, 1
         16        SR                                               ~11     1, ~10
         17        ASSIGN                                                   !0, ~11
   13    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.7 ms | 1395 KiB | 17 Q