3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "device_id=LA14011269&card_number=1073741835&mpb=1000&trans_time=1429443693&sessionId=1073741835LA140112691429443693&checksum=4"; echo checkBcc($str,4); function checkBcc($str, $check_sum) { $i=0; $checksum = 0; $result = false; $len = strlen($str); echo " str:".$str; $pBuf = explode($str); print_r($pBuf); for ($i = 0; $i < $len-2; $i++) { $checksum ^= $pBuf[$i]; } echo "checksum:". $checksum; if ($checksum == $check_sum) { $result = true; } return $result; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TF53C
function name:  (null)
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'device_id%3DLA14011269%26card_number%3D1073741835%26mpb%3D1000%26trans_time%3D1429443693%26sessionId%3D1073741835LA140112691429443693%26checksum%3D4'
    4     1        INIT_FCALL_BY_NAME                                       'checkBcc'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              4
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
   27     6      > RETURN                                                   1

Function checkbcc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 18
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 18
Branch analysis from position: 24
Branch analysis from position: 18
filename:       /in/TF53C
function name:  checkBcc
number of ops:  31
compiled vars:  !0 = $str, !1 = $check_sum, !2 = $i, !3 = $checksum, !4 = $result, !5 = $len, !6 = $pBuf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ASSIGN                                                   !2, 0
    8     3        ASSIGN                                                   !3, 0
    9     4        ASSIGN                                                   !4, <false>
   11     5        STRLEN                                           ~10     !0
          6        ASSIGN                                                   !5, ~10
   12     7        CONCAT                                           ~12     '+str%3A', !0
          8        ECHO                                                     ~12
   13     9        INIT_FCALL                                               'explode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $13     
         12        ASSIGN                                                   !6, $13
   14    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !6
         15        DO_ICALL                                                 
   16    16        ASSIGN                                                   !2, 0
         17      > JMP                                                      ->21
   17    18    >   FETCH_DIM_R                                      ~17     !6, !2
         19        ASSIGN_OP                                    11          !3, ~17
   16    20        PRE_INC                                                  !2
         21    >   SUB                                              ~20     !5, 2
         22        IS_SMALLER                                               !2, ~20
         23      > JMPNZ                                                    ~21, ->18
   19    24    >   CONCAT                                           ~22     'checksum%3A', !3
         25        ECHO                                                     ~22
   21    26        IS_EQUAL                                                 !3, !1
         27      > JMPZ                                                     ~23, ->29
   22    28    >   ASSIGN                                                   !4, <true>
   25    29    > > RETURN                                                   !4
   26    30*     > RETURN                                                   null

End of function checkbcc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.5 ms | 1400 KiB | 17 Q