3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "ABCDEFGHIK"; $num = str_split($text ,3); $cnt = 0; $total = 0; for($b = 0; $b<3; $b++){ $cnt = strlen($num[$b]); $total += $cnt; } echo $cnt; echo "\n"; echo $total;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/vdnou
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $num, !2 = $cnt, !3 = $total, !4 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ABCDEFGHIK'
    4     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 3
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    5     6        ASSIGN                                                   !2, 0
    6     7        ASSIGN                                                   !3, 0
    7     8        ASSIGN                                                   !4, 0
          9      > JMP                                                      ->15
    8    10    >   FETCH_DIM_R                                      ~11     !1, !4
         11        STRLEN                                           ~12     ~11
         12        ASSIGN                                                   !2, ~12
    9    13        ASSIGN_OP                                     1          !3, !2
    7    14        PRE_INC                                                  !4
         15    >   IS_SMALLER                                               !4, 3
         16      > JMPNZ                                                    ~16, ->10
   11    17    >   ECHO                                                     !2
   12    18        ECHO                                                     '%0A'
   13    19        ECHO                                                     !3
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.77 ms | 1395 KiB | 15 Q