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 ) { $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/03oY9
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 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
Branch analysis from position: 9
filename:       /in/03oY9
function name:  removeThirdLetter
number of ops:  15
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                                                      ->10
    6     4    >   MOD                                              ~5      !2, 3
          5        IS_NOT_EQUAL                                             ~5, 0
          6      > JMPZ                                                     ~6, ->9
    7     7    >   FETCH_DIM_R                                      ~7      !0, !2
          8        ASSIGN_OP                                     8          !1, ~7
    5     9    >   PRE_INC                                                  !2
         10    >   STRLEN                                           ~10     !0
         11        IS_SMALLER                                               !2, ~10
         12      > JMPNZ                                                    ~11, ->4
   10    13    > > RETURN                                                   !1
   11    14*     > RETURN                                                   null

End of function removethirdletter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.64 ms | 1389 KiB | 14 Q