3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = 451; $sum = 0; for($i=0; $i<strlen($d); $i++) { $sum += (int)substr($d, $i, 1); } print $sum;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
Branch analysis from position: 4
filename:       /in/AC75i
function name:  (null)
number of ops:  17
compiled vars:  !0 = $d, !1 = $sum, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 451
    5     1        ASSIGN                                                   !1, 0
    6     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->12
    7     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $6      
          9        CAST                                          4  ~7      $6
         10        ASSIGN_OP                                     1          !1, ~7
    6    11        PRE_INC                                                  !2
         12    >   STRLEN                                           ~10     !0
         13        IS_SMALLER                                               !2, ~10
         14      > JMPNZ                                                    ~11, ->4
    9    15    >   ECHO                                                     !1
   10    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
204.02 ms | 1395 KiB | 15 Q