3v4l.org

run code in 300+ 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 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 3
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 3
Branch analysis from position: 32
Branch analysis from position: 3
filename:       /in/GdIfs
function name:  (null)
number of ops:  33
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                                                      ->29
   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        INIT_FCALL                                               'dechex'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $21     
         21        CONCAT                                           ~22     $21, '++'
         22        INIT_FCALL                                               'dechex'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $23     
         25        CONCAT                                           ~24     ~22, $23
         26        CONCAT                                           ~25     ~24, '%0A'
         27        ECHO                                                     ~25
    7    28        ASSIGN_OP                                     1          !1, 3
         29    >   COUNT                                            ~27     !0
         30        IS_SMALLER                                               !1, ~27
         31      > JMPNZ                                                    ~28, ->3
   17    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.95 ms | 999 KiB | 14 Q