3v4l.org

run code in 300+ 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:  23
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBbKfX%3A4%240'
          5        SEND_VAL                                                 ~1
          6        INIT_FCALL                                               'array_filter'
          7        INIT_FCALL                                               'array_map'
          8        SEND_VAL                                                 'trim'
          9        INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '+'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $2      
         13        SEND_VAR                                                 $2
         14        DO_ICALL                                         $3      
         15        SEND_VAR                                                 $3
         16        DO_ICALL                                         $4      
         17        SEND_VAR                                                 $4
         18        DO_ICALL                                         $5      
         19        SEND_VAR                                                 $5
         20        DO_ICALL                                         $6      
         21      > RETURN                                                   $6
    5    22*     > RETURN                                                   null

End of function first_letter

Function %00%7Bclosure%7D%2Fin%2FBbKfX%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BbKfX
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FBbKfX%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.77 ms | 1403 KiB | 22 Q