3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeThirdLetter($sentence) { $output = ""; for ( $i = 0; $i < strlen($sentence); $i++ ) { if ( $i % 3 == 0 || $i % 3 != 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/ROKIA
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 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 10
filename:       /in/ROKIA
function name:  removeThirdLetter
number of ops:  19
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                                                      ->14
    6     4    >   MOD                                              ~5      !2, 3
          5        IS_EQUAL                                         ~6      ~5, 0
          6      > JMPNZ_EX                                         ~6      ~6, ->10
          7    >   MOD                                              ~7      !2, 3
          8        IS_NOT_EQUAL                                     ~8      ~7, 0
          9        BOOL                                             ~6      ~8
         10    > > JMPZ                                                     ~6, ->13
    7    11    >   FETCH_DIM_R                                      ~9      !0, !2
         12        ASSIGN_OP                                     8          !1, ~9
    5    13    >   PRE_INC                                                  !2
         14    >   STRLEN                                           ~12     !0
         15        IS_SMALLER                                               !2, ~12
         16      > JMPNZ                                                    ~13, ->4
   10    17    > > RETURN                                                   !1
   11    18*     > RETURN                                                   null

End of function removethirdletter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.31 ms | 1403 KiB | 14 Q