3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.54 ms | 1400 KiB | 15 Q