3v4l.org

run code in 300+ PHP versions simultaneously
<?php const READ = 1; const WRITE = 2; function test($mask) { if ($mask & READ && $mask & WRITE) { echo 'Read/Write!' . PHP_EOL; } if ($mask & WRITE) { echo 'Write!' . PHP_EOL; } } test(0); test(READ); test(WRITE); test(READ | WRITE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8uK6K
function name:  (null)
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'READ', 1
    4     1        DECLARE_CONST                                            'WRITE', 2
   18     2        INIT_FCALL                                               'test'
          3        SEND_VAL                                                 0
          4        DO_FCALL                                      0          
   19     5        INIT_FCALL                                               'test'
          6        FETCH_CONSTANT                                   ~1      'READ'
          7        SEND_VAL                                                 ~1
          8        DO_FCALL                                      0          
   20     9        INIT_FCALL                                               'test'
         10        FETCH_CONSTANT                                   ~3      'WRITE'
         11        SEND_VAL                                                 ~3
         12        DO_FCALL                                      0          
   21    13        INIT_FCALL                                               'test'
         14        FETCH_CONSTANT                                   ~5      'READ'
         15        FETCH_CONSTANT                                   ~6      'WRITE'
         16        BW_OR                                            ~7      ~5, ~6
         17        SEND_VAL                                                 ~7
         18        DO_FCALL                                      0          
         19      > RETURN                                                   1

Function test:
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
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 9
Branch analysis from position: 7
filename:       /in/8uK6K
function name:  test
number of ops:  14
compiled vars:  !0 = $mask
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        FETCH_CONSTANT                                   ~1      'READ'
          2        BW_AND                                           ~2      !0, ~1
          3      > JMPZ_EX                                          ~2      ~2, ->7
          4    >   FETCH_CONSTANT                                   ~3      'WRITE'
          5        BW_AND                                           ~4      !0, ~3
          6        BOOL                                             ~2      ~4
          7    > > JMPZ                                                     ~2, ->9
    9     8    >   ECHO                                                     'Read%2FWrite%21%0A'
   12     9    >   FETCH_CONSTANT                                   ~5      'WRITE'
         10        BW_AND                                           ~6      !0, ~5
         11      > JMPZ                                                     ~6, ->13
   13    12    >   ECHO                                                     'Write%21%0A'
   16    13    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.72 ms | 1399 KiB | 17 Q