3v4l.org

run code in 500+ PHP versions simultaneously
<?php function first_letter($str) { return implode('', array_map(function($v) { return $v[0]; },array_filter(array_map('trim',explode(' ', $str)))));; } $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/BbKfX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                       !0, '++++Let%27s+++try+++with++++more+++spaces+++++++for++fun+.+++'
    9     1        INIT_FCALL                                                   'first_letter'
          2        SEND_VAR                                                     !0
          3        DO_FCALL                                          0  $2      
          4        ECHO                                                         $2
   10     5      > RETURN                                                       1

Function first_letter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BbKfX
function name:  first_letter
number of ops:  20
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          3        SEND_VAL                                                     ~1
          4        INIT_FCALL                                                   'array_filter'
          5        INIT_FCALL                                                   'array_map'
          6        SEND_VAL                                                     'trim'
          7        INIT_FCALL                                                   'explode'
          8        SEND_VAL                                                     '+'
          9        SEND_VAR                                                     !0
         10        DO_ICALL                                             $2      
         11        SEND_VAR                                                     $2
         12        DO_ICALL                                             $3      
         13        SEND_VAR                                                     $3
         14        DO_ICALL                                             $4      
         15        SEND_VAR                                                     $4
         16        DO_ICALL                                             $5      
         17        FRAMELESS_ICALL_2                implode             ~6      '', $5
         18      > RETURN                                                       ~6
    5    19*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BbKfX
function name:  {closure:first_letter():4}
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 0
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 0

End of function first_letter

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
235.07 ms | 3307 KiB | 17 Q