3v4l.org

run code in 300+ PHP versions simultaneously
<?php function first_letter($str) { $arr2 = array_filter(array_map('trim',explode(' ', $str))); $result=''; foreach($arr2 as $v) { $result.=$v[0]; } return $result; } $str=" Let's try with more spaces for fun . "; echo first_letter($str); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cd9FE
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, '++++Let%27s+++try+++with++++more+++spaces+++++++for++fun+.+++'
   15     1        INIT_FCALL                                               'first_letter'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   16     5      > RETURN                                                   1

Function first_letter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/cd9FE
function name:  first_letter
number of ops:  22
compiled vars:  !0 = $str, !1 = $arr2, !2 = $result, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'array_filter'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'trim'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '+'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
    5    13        ASSIGN                                                   !2, ''
    6    14      > FE_RESET_R                                       $9      !1, ->19
         15    > > FE_FETCH_R                                               $9, !3, ->19
    8    16    >   FETCH_DIM_R                                      ~10     !3, 0
         17        ASSIGN_OP                                     8          !2, ~10
    6    18      > JMP                                                      ->15
         19    >   FE_FREE                                                  $9
   10    20      > RETURN                                                   !2
   11    21*     > RETURN                                                   null

End of function first_letter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.68 ms | 1399 KiB | 20 Q