3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.52 ms | 1386 KiB | 13 Q