3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'ZpglnRxqenU'; // Expected: 'Z-Pp-Ggg-Llll-Nnnnn-Rrrrrr-Xxxxxxx-Qqqqqqqq-Eeeeeeeee-Nnnnnnnnnn-Uuuuuuuuuuu' $array = []; for ($i = 0, $length = strlen($input); $i < $length; ++$i) { $array[] = str_repeat($input[$i], $i + 1); } var_export( mb_convert_case( implode('-', $array), MB_CASE_TITLE ) );
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 = 6
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
filename:       /in/iaSKf
function name:  (null)
number of ops:  29
compiled vars:  !0 = $input, !1 = $array, !2 = $i, !3 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ZpglnRxqenU'
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, 0
          3        STRLEN                                           ~7      !0
          4        ASSIGN                                                   !3, ~7
          5      > JMP                                                      ->15
    8     6    >   INIT_FCALL                                               'str_repeat'
          7        FETCH_DIM_R                                      ~10     !0, !2
          8        SEND_VAL                                                 ~10
          9        ADD                                              ~11     !2, 1
         10        SEND_VAL                                                 ~11
         11        DO_ICALL                                         $12     
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $12
    7    14        PRE_INC                                                  !2
         15    >   IS_SMALLER                                               !2, !3
         16      > JMPNZ                                                    ~14, ->6
   10    17    >   INIT_FCALL                                               'var_export'
   11    18        INIT_FCALL                                               'mb_convert_case'
   12    19        INIT_FCALL                                               'implode'
         20        SEND_VAL                                                 '-'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $15     
         23        SEND_VAR                                                 $15
   13    24        SEND_VAL                                                 2
   11    25        DO_ICALL                                         $16     
   13    26        SEND_VAR                                                 $16
   10    27        DO_ICALL                                                 
   15    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
219.01 ms | 1009 KiB | 17 Q