3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeLowerCharBeforeUpperChar(string $input): string { $output = ''; $length = strlen($input); for ($offset = 0; $offset < $length; ++$offset) { $nextLetter = $input[$offset + 1] ?? ''; if (ctype_lower($input[$offset]) && ctype_upper($nextLetter)) { $output .= $nextLetter; // omit current letter ++$offset; // double iterate } else { $output .= $input[$offset]; } } return $output; } echo removeLowerCharBeforeUpperChar('MickMacKusa');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mT7Of
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'removelowercharbeforeupperchar'
          1        SEND_VAL                                                 'MickMacKusa'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function removelowercharbeforeupperchar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
Branch analysis from position: 6
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
Branch analysis from position: 6
Branch analysis from position: 20
filename:       /in/mT7Of
function name:  removeLowerCharBeforeUpperChar
number of ops:  33
compiled vars:  !0 = $input, !1 = $output, !2 = $length, !3 = $offset, !4 = $nextLetter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    6     2        STRLEN                                           ~6      !0
          3        ASSIGN                                                   !2, ~6
    7     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->27
    8     6    >   ADD                                              ~9      !3, 1
          7        FETCH_DIM_IS                                     ~10     !0, ~9
          8        COALESCE                                         ~11     ~10
          9        QM_ASSIGN                                        ~11     ''
         10        ASSIGN                                                   !4, ~11
    9    11        INIT_FCALL                                               'ctype_lower'
         12        FETCH_DIM_R                                      ~13     !0, !3
         13        SEND_VAL                                                 ~13
         14        DO_ICALL                                         $14     
         15      > JMPZ_EX                                          ~15     $14, ->20
         16    >   INIT_FCALL                                               'ctype_upper'
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                         $16     
         19        BOOL                                             ~15     $16
         20    > > JMPZ                                                     ~15, ->24
   10    21    >   ASSIGN_OP                                     8          !1, !4
   11    22        PRE_INC                                                  !3
    9    23      > JMP                                                      ->26
   13    24    >   FETCH_DIM_R                                      ~19     !0, !3
         25        ASSIGN_OP                                     8          !1, ~19
    7    26    >   PRE_INC                                                  !3
         27    >   IS_SMALLER                                               !3, !2
         28      > JMPNZ                                                    ~22, ->6
   16    29    >   VERIFY_RETURN_TYPE                                       !1
         30      > RETURN                                                   !1
   17    31*       VERIFY_RETURN_TYPE                                       
         32*     > RETURN                                                   null

End of function removelowercharbeforeupperchar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.19 ms | 1018 KiB | 16 Q