3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "ABCDEFGHIK"; $num = str_split($text ,3); var_dump($num); $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 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
Branch analysis from position: 13
filename:       /in/fdYGU
function name:  (null)
number of ops:  24
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        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    6     9        ASSIGN                                                   !2, 0
    7    10        ASSIGN                                                   !3, 0
    8    11        ASSIGN                                                   !4, 0
         12      > JMP                                                      ->18
    9    13    >   FETCH_DIM_R                                      ~12     !1, !4
         14        STRLEN                                           ~13     ~12
         15        ASSIGN                                                   !2, ~13
   10    16        ASSIGN_OP                                     1          !3, !2
    8    17        PRE_INC                                                  !4
         18    >   IS_SMALLER                                               !4, 3
         19      > JMPNZ                                                    ~17, ->13
   12    20    >   ECHO                                                     !2
   13    21        ECHO                                                     '%0A'
   14    22        ECHO                                                     !3
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.11 ms | 1395 KiB | 17 Q