3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dc09crc($data) { function calc_crc($crc, $debyte) { $deze = ord($debyte); foreach (range(0, 7) as $i) { $deze ^= $crc & 1; $crc >>= 1; if ($deze & 1) { $crc ^= 0xa001; } $deze >>= 1; } return $crc; } $crc = 0; foreach (range(0, strlen($data)-1) as $j) { $crc = calc_crc($crc, $data[$j]); } return $crc; } $response = '7CFD0011"ACK"0001#00411[]'; $t = explode('"', $response); $payload = ""; foreach(range(1, sizeof($t)-1) as $e) { echo $e; } //if ($tokens[0] != dc89crc()
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/STbrV
function name:  (null)
number of ops:  19
compiled vars:  !0 = $response, !1 = $t, !2 = $payload, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ASSIGN                                                   !0, '7CFD0011%22ACK%220001%2300411%5B%5D'
   25     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%22'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   26     6        ASSIGN                                                   !2, ''
   27     7        INIT_FCALL                                               'range'
          8        SEND_VAL                                                 1
          9        COUNT                                            ~8      !1
         10        SUB                                              ~9      ~8, 1
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                         $10     
         13      > FE_RESET_R                                       $11     $10, ->17
         14    > > FE_FETCH_R                                               $11, !3, ->17
   28    15    >   ECHO                                                     !3
   27    16      > JMP                                                      ->14
         17    >   FE_FREE                                                  $11
   31    18      > RETURN                                                   1

Function dc09crc:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/STbrV
function name:  dc09crc
number of ops:  22
compiled vars:  !0 = $data, !1 = $crc, !2 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_FUNCTION                                         'calc_crc'
   16     2        ASSIGN                                                   !1, 0
   18     3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 0
          5        STRLEN                                           ~4      !0
          6        SUB                                              ~5      ~4, 1
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                         $6      
          9      > FE_RESET_R                                       $7      $6, ->19
         10    > > FE_FETCH_R                                               $7, !2, ->19
   19    11    >   INIT_FCALL_BY_NAME                                       'calc_crc'
         12        SEND_VAR_EX                                              !1
         13        CHECK_FUNC_ARG                                           
         14        FETCH_DIM_FUNC_ARG                               $8      !0, !2
         15        SEND_FUNC_ARG                                            $8
         16        DO_FCALL                                      0  $9      
         17        ASSIGN                                                   !1, $9
   18    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $7
   21    20      > RETURN                                                   !1
   22    21*     > RETURN                                                   null

End of function dc09crc

Function %00calc_crc%2Fin%2FSTbrV%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/STbrV
function name:  calc_crc
number of ops:  23
compiled vars:  !0 = $crc, !1 = $debyte, !2 = $deze, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'ord'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !2, $4
    6     6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 7
          9        DO_ICALL                                         $6      
         10      > FE_RESET_R                                       $7      $6, ->20
         11    > > FE_FETCH_R                                               $7, !3, ->20
    7    12    >   BW_AND                                           ~8      !0, 1
         13        ASSIGN_OP                                    11          !2, ~8
    8    14        ASSIGN_OP                                     7          !0, 1
    9    15        BW_AND                                           ~11     !2, 1
         16      > JMPZ                                                     ~11, ->18
   10    17    >   ASSIGN_OP                                    11          !0, 40961
   12    18    >   ASSIGN_OP                                     7          !2, 1
    6    19      > JMP                                                      ->11
         20    >   FE_FREE                                                  $7
   14    21      > RETURN                                                   !0
   15    22*     > RETURN                                                   null

End of function %00calc_crc%2Fin%2FSTbrV%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.51 ms | 1400 KiB | 19 Q