3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class bar { public const FLAG = 0b0010; public static function foo(string $v, int $flags) { if ((($flags & self::FLAG) && !isset($v[0]))) { return true; } return false; } } var_dump(bar::foo('', 0b0010));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72d5f
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'bar', 'foo'
          2        SEND_VAL                                                 ''
          3        SEND_VAL                                                 2
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class bar:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/72d5f
function name:  foo
number of ops:  11
compiled vars:  !0 = $v, !1 = $flags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        BW_AND                                           ~2      !1, 2
          3      > JMPZ_EX                                          ~2      ~2, ->7
          4    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !0, 0
          5        BOOL_NOT                                         ~4      ~3
          6        BOOL                                             ~2      ~4
          7    > > JMPZ                                                     ~2, ->9
    8     8    > > RETURN                                                   <true>
   11     9    > > RETURN                                                   <false>
   12    10*     > RETURN                                                   null

End of function foo

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.64 ms | 1395 KiB | 15 Q