3v4l.org

run code in 300+ PHP versions simultaneously
<?php $words = array( 'John Doe', 'Jane Adams', 'Michael McDonald', 'Jim' ); $initials = implode('/', array_map(function ($name) { return preg_replace('/(?<=\w)./', '', $name); }, $words)); echo $initials;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cUgfa
function name:  (null)
number of ops:  13
compiled vars:  !0 = $words, !1 = $initials
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%2F'
          3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   12     5        SEND_VAL                                                 ~3
          6        SEND_VAR                                                 !0
   10     7        DO_ICALL                                         $4      
   12     8        SEND_VAR                                                 $4
   10     9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
   13    11        ECHO                                                     !1
   14    12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cUgfa
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%3F%3C%3D%5Cw%29.%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
   12     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.67 ms | 1012 KiB | 16 Q