3v4l.org

run code in 300+ PHP versions simultaneously
<?php function accum($s) { $split = str_split($s, 1); $out = ''; foreach ($split as $idx => $char) { if ($idx > 0) { $out .= '-'; } $out .= ucfirst(str_repeat($char, $idx + 1)); } return $out; } echo accum('zpglnrxqenu');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qHb7S
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'accum'
          1        SEND_VAL                                                 'zpglnrxqenu'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function accum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/qHb7S
function name:  accum
number of ops:  26
compiled vars:  !0 = $s, !1 = $split, !2 = $out, !3 = $char, !4 = $idx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    5     6        ASSIGN                                                   !2, ''
    6     7      > FE_RESET_R                                       $8      !1, ->23
          8    > > FE_FETCH_R                                       ~9      $8, !3, ->23
          9    >   ASSIGN                                                   !4, ~9
    7    10        IS_SMALLER                                               0, !4
         11      > JMPZ                                                     ~11, ->13
    8    12    >   ASSIGN_OP                                     8          !2, '-'
   10    13    >   INIT_FCALL                                               'ucfirst'
         14        INIT_FCALL                                               'str_repeat'
         15        SEND_VAR                                                 !3
         16        ADD                                              ~13     !4, 1
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                         $14     
         19        SEND_VAR                                                 $14
         20        DO_ICALL                                         $15     
         21        ASSIGN_OP                                     8          !2, $15
    6    22      > JMP                                                      ->8
         23    >   FE_FREE                                                  $8
   13    24      > RETURN                                                   !2
   14    25*     > RETURN                                                   null

End of function accum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.89 ms | 1399 KiB | 20 Q