3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "abcdefghijklmn"; $arr= str_split($str); $nstr=""; foreach($arr as $k=>$v) { if($k%2!=0){ $nstr.= $v; } } echo strrev($nstr); //"prints" nljhfdb
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/on56b
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $arr, !2 = $nstr, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'abcdefghijklmn'
    3     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    4     5        ASSIGN                                                   !2, ''
    5     6      > FE_RESET_R                                       $9      !1, ->14
          7    > > FE_FETCH_R                                       ~10     $9, !3, ->14
          8    >   ASSIGN                                                   !4, ~10
    7     9        MOD                                              ~12     !4, 2
         10        IS_NOT_EQUAL                                             ~12, 0
         11      > JMPZ                                                     ~13, ->13
    8    12    >   ASSIGN_OP                                     8          !2, !3
    5    13    > > JMP                                                      ->7
         14    >   FE_FREE                                                  $9
   11    15        INIT_FCALL                                               'strrev'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $15     
         18        ECHO                                                     $15
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.33 ms | 1395 KiB | 17 Q