3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isLeverOn($data, $number) { return $data & (2 ** $number); } $levers = 0b01010101; for ($i = 0; $i < 8; $i ++) { $status = isLeverOn($levers, $i) ? "ON" : "OFF"; echo "lever $i is $status.\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 3
Branch analysis from position: 21
Branch analysis from position: 3
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 3
Branch analysis from position: 21
Branch analysis from position: 3
filename:       /in/pd4L7
function name:  (null)
number of ops:  22
compiled vars:  !0 = $levers, !1 = $i, !2 = $status
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 85
    9     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->19
   10     3    >   INIT_FCALL                                               'isleveron'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $5      
          7      > JMPZ                                                     $5, ->10
          8    >   QM_ASSIGN                                        ~6      'ON'
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~6      'OFF'
         11    >   ASSIGN                                                   !2, ~6
   11    12        ROPE_INIT                                     5  ~9      'lever+'
         13        ROPE_ADD                                      1  ~9      ~9, !1
         14        ROPE_ADD                                      2  ~9      ~9, '+is+'
         15        ROPE_ADD                                      3  ~9      ~9, !2
         16        ROPE_END                                      4  ~8      ~9, '.%0A'
         17        ECHO                                                     ~8
    9    18        PRE_INC                                                  !1
         19    >   IS_SMALLER                                               !1, 8
         20      > JMPNZ                                                    ~13, ->3
   12    21    > > RETURN                                                   1

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

End of function isleveron

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.16 ms | 1403 KiB | 14 Q