3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $val = 12; $bin_val = 1 << ($val -1); var_dump($bin_val); var_dump(pow(2, $val)); $val = 1 >> ($val - 1); var_dump($val);
based on vHlpi
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/SvsZ6
function name:  (null)
number of ops:  21
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        SEND_VAR                                                 !0
        11        DO_ICALL                                         $7      
        12        SEND_VAR                                                 $7
        13        DO_ICALL                                                 
  12    14        SUB                                              ~9      !0, 1
        15        SR                                               ~10     1, ~9
        16        ASSIGN                                                   !0, ~10
  13    17        INIT_FCALL                                               'var_dump'
        18        SEND_VAR                                                 !0
        19        DO_ICALL                                                 
        20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0