3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeThirdLetter($sentence) { $output = ""; for ( $i = 0; $i < strlen($sentence); $i++ ) { if ( $i == 0 || $i % 2 != 0 ) { $output .= $sentence[$i]; } } return $output; } $str = "Frank Sinatra"; echo removeThirdLetter($str); // should return "FrnkSiata" ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iCGjb
function name:  (null)
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'Frank+Sinatra'
   14     1        INIT_FCALL                                               'removethirdletter'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   16     5      > RETURN                                                   1

Function removethirdletter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
Branch analysis from position: 12
Branch analysis from position: 9
filename:       /in/iCGjb
function name:  removeThirdLetter
number of ops:  18
compiled vars:  !0 = $sentence, !1 = $output, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->13
    6     4    >   IS_EQUAL                                         ~5      !2, 0
          5      > JMPNZ_EX                                         ~5      ~5, ->9
          6    >   MOD                                              ~6      !2, 2
          7        IS_NOT_EQUAL                                     ~7      ~6, 0
          8        BOOL                                             ~5      ~7
          9    > > JMPZ                                                     ~5, ->12
    7    10    >   FETCH_DIM_R                                      ~8      !0, !2
         11        ASSIGN_OP                                     8          !1, ~8
    5    12    >   PRE_INC                                                  !2
         13    >   STRLEN                                           ~11     !0
         14        IS_SMALLER                                               !2, ~11
         15      > JMPNZ                                                    ~12, ->4
   10    16    > > RETURN                                                   !1
   11    17*     > RETURN                                                   null

End of function removethirdletter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.32 ms | 1399 KiB | 14 Q