3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = "03255000000"; //$len = strlen($code); $code = substr("03255000000", 0, (strlen($code)-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/vFkRs
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'
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAL                                                 '03255000000'
          3        SEND_VAL                                                 0
          4        STRLEN                                           ~7      !0
          5        SUB                                              ~8      ~7, 1
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !0, $9
    5     9        STRLEN                                           ~11     !0
         10        ASSIGN                                                   !1, ~11
    6    11        ASSIGN                                                   !2, 0
    7    12        ASSIGN                                                   !3, 1
    8    13        ASSIGN                                                   !4, 0
   11    14    >   IS_SMALLER                                               10, !3
         15      > JMPZ                                                     ~16, ->18
         16    >   QM_ASSIGN                                        ~17     1
         17      > JMP                                                      ->20
         18    >   POST_INC                                         ~18     !3
         19        QM_ASSIGN                                        ~17     ~18
         20    >   ASSIGN                                                   !3, ~17
   12    21        FETCH_DIM_R                                      ~20     !0, !2
         22        MUL                                              ~21     !3, ~20
         23        ASSIGN                                                   !5, ~21
   13    24        ADD                                              ~23     !4, !5
         25        ASSIGN                                                   !4, ~23
   14    26        CONCAT                                           ~25     !2, '%3A+'
         27        FETCH_DIM_R                                      ~26     !0, !2
         28        CONCAT                                           ~27     ~25, ~26
         29        ROPE_INIT                                     7  ~29     '+%2A+'
         30        ROPE_ADD                                      1  ~29     ~29, !3
         31        ROPE_ADD                                      2  ~29     ~29, '+%3D+'
         32        ROPE_ADD                                      3  ~29     ~29, !5
         33        ROPE_ADD                                      4  ~29     ~29, '+sum+%3D+'
         34        ROPE_ADD                                      5  ~29     ~29, !4
         35        ROPE_END                                      6  ~28     ~29, '%0A'
         36        CONCAT                                           ~33     ~27, ~28
         37        ECHO                                                     ~33
   15    38        PRE_INC                                                  !2
   16    39        PRE_INC                                                  !3
   17    40        IS_SMALLER                                               !2, !1
         41      > JMPNZ                                                    ~36, ->14
   18    42    >   MOD                                              ~37     !4, 11
         43        CAST                                          6  ~38     ~37
         44        ECHO                                                     ~38
   19    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.65 ms | 1400 KiB | 15 Q