3v4l.org

run code in 500+ PHP versions simultaneously
<?php //Stel je hebt een byte array $raw=[0xAB, 0x56, 0xFD]; //Dan per 3 bytes uitlezen in een loop for($idx=0;$idx<count($raw);$idx+=3) { //en schuiven met bits met << of >> //of gebruik maken van logical AND: & $v1 = ($raw[$idx] << 4) + ( $raw[$idx+1] >> 4); $v2 = (($raw[$idx+1] & 0xF) << 8) + $raw[$idx+2]; //resultaat, in hex voor de duidelijkheid echo dechex($v1) . " " . dechex($v2) . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
Branch analysis from position: 3
filename:       /in/GdIfs
function name:  (null)
number of ops:  29
compiled vars:  !0 = $raw, !1 = $idx, !2 = $v1, !3 = $v2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
    7     1        ASSIGN                                                       !1, 0
          2      > JMP                                                          ->25
   10     3    >   FETCH_DIM_R                                          ~6      !0, !1
          4        SL                                                   ~7      ~6, 4
          5        ADD                                                  ~8      !1, 1
          6        FETCH_DIM_R                                          ~9      !0, ~8
          7        SR                                                   ~10     ~9, 4
          8        ADD                                                  ~11     ~7, ~10
          9        ASSIGN                                                       !2, ~11
   11    10        ADD                                                  ~13     !1, 1
         11        FETCH_DIM_R                                          ~14     !0, ~13
         12        BW_AND                                               ~15     ~14, 15
         13        SL                                                   ~16     ~15, 8
         14        ADD                                                  ~17     !1, 2
         15        FETCH_DIM_R                                          ~18     !0, ~17
         16        ADD                                                  ~19     ~16, ~18
         17        ASSIGN                                                       !3, ~19
   14    18        FRAMELESS_ICALL_1                dechex              ~21     !2
         19        CONCAT                                               ~22     ~21, '++'
         20        FRAMELESS_ICALL_1                dechex              ~23     !3
         21        CONCAT                                               ~24     ~22, ~23
         22        CONCAT                                               ~25     ~24, '%0A'
         23        ECHO                                                         ~25
    7    24        ASSIGN_OP                                         1          !1, 3
         25    >   COUNT                                                ~27     !0
         26        IS_SMALLER                                                   !1, ~27
         27      > JMPNZ                                                        ~28, ->3
   17    28    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.79 ms | 2094 KiB | 13 Q