3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = "03255000000"; $len = strlen($code); $code = left("03255000000", ($len -1)); $len = strlen($code); $i = 0; $r = 1; $sum = 0; do { $r = ($r > 10)?1:$r++; $s = ($code[$i]*$r); $sum = ($sum + $s); echo $i.": ".$code[$i]." * $r = $s sum = $sum\n"; $i++; $r++; }while($i < $len); echo (string)($sum%11); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 14
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 14
Branch analysis from position: 42
Branch analysis from position: 14
filename:       /in/Bk9W0
function name:  (null)
number of ops:  46
compiled vars:  !0 = $code, !1 = $len, !2 = $i, !3 = $r, !4 = $sum, !5 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '03255000000'
    3     1        STRLEN                                           ~7      !0
          2        ASSIGN                                                   !1, ~7
    4     3        INIT_FCALL_BY_NAME                                       'left'
          4        SEND_VAL_EX                                              '03255000000'
          5        SUB                                              ~9      !1, 1
          6        SEND_VAL_EX                                              ~9
          7        DO_FCALL                                      0  $10     
          8        ASSIGN                                                   !0, $10
    5     9        STRLEN                                           ~12     !0
         10        ASSIGN                                                   !1, ~12
    6    11        ASSIGN                                                   !2, 0
    7    12        ASSIGN                                                   !3, 1
    8    13        ASSIGN                                                   !4, 0
   11    14    >   IS_SMALLER                                               10, !3
         15      > JMPZ                                                     ~17, ->18
         16    >   QM_ASSIGN                                        ~18     1
         17      > JMP                                                      ->20
         18    >   POST_INC                                         ~19     !3
         19        QM_ASSIGN                                        ~18     ~19
         20    >   ASSIGN                                                   !3, ~18
   12    21        FETCH_DIM_R                                      ~21     !0, !2
         22        MUL                                              ~22     !3, ~21
         23        ASSIGN                                                   !5, ~22
   13    24        ADD                                              ~24     !4, !5
         25        ASSIGN                                                   !4, ~24
   14    26        CONCAT                                           ~26     !2, '%3A+'
         27        FETCH_DIM_R                                      ~27     !0, !2
         28        CONCAT                                           ~28     ~26, ~27
         29        ROPE_INIT                                     7  ~30     '+%2A+'
         30        ROPE_ADD                                      1  ~30     ~30, !3
         31        ROPE_ADD                                      2  ~30     ~30, '+%3D+'
         32        ROPE_ADD                                      3  ~30     ~30, !5
         33        ROPE_ADD                                      4  ~30     ~30, '+sum+%3D+'
         34        ROPE_ADD                                      5  ~30     ~30, !4
         35        ROPE_END                                      6  ~29     ~30, '%0A'
         36        CONCAT                                           ~34     ~28, ~29
         37        ECHO                                                     ~34
   15    38        PRE_INC                                                  !2
   16    39        PRE_INC                                                  !3
   17    40        IS_SMALLER                                               !2, !1
         41      > JMPNZ                                                    ~37, ->14
   18    42    >   MOD                                              ~38     !4, 11
         43        CAST                                          6  ~39     ~38
         44        ECHO                                                     ~39
   19    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.44 ms | 1399 KiB | 13 Q