3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateUserFIO(array $names) { return implode( ' ', [ ucfirst(strtolower($names['last_name'])), (substr($names['first_name'], 0, 1) . '.'), (substr($names['middle_name'], 0, 1) . '.'), ] ); } print_r(generateUserFIO([ 'last_name' => 'Гопкало', 'first_name' => 'Никита', 'middle_name' => 'Владимирович', ])) . PHP_EOL; function generateUserFIO2(array $names) { return implode( ' ', [ ucfirst(strtolower($names['last_name'])), (substr($names['first_name'], 0, 2) . '.'), (substr($names['middle_name'], 0, 2) . '.'), ] ); } print_r(generateUserFIO2([ 'last_name' => 'Гопкало', 'first_name' => 'Никита', 'middle_name' => 'Владимирович', ]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hhNpG
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'generateuserfio'
   15     2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $1      
   18     6        CONCAT                                           ~2      $1, '%0A'
          7        FREE                                                     ~2
   32     8        INIT_FCALL                                               'print_r'
          9        INIT_FCALL                                               'generateuserfio2'
   33    10        SEND_VAL                                                 <array>
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                                 
   36    14      > RETURN                                                   1

Function generateuserfio:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hhNpG
function name:  generateUserFIO
number of ops:  31
compiled vars:  !0 = $names
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'implode'
    5     2        SEND_VAL                                                 '+'
    7     3        INIT_FCALL                                               'ucfirst'
          4        INIT_FCALL                                               'strtolower'
          5        FETCH_DIM_R                                      ~1      !0, 'last_name'
          6        SEND_VAL                                                 ~1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        INIT_ARRAY                                       ~4      $3
    8    11        INIT_FCALL                                               'substr'
         12        FETCH_DIM_R                                      ~5      !0, 'first_name'
         13        SEND_VAL                                                 ~5
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $6      
         17        CONCAT                                           ~7      $6, '.'
         18        ADD_ARRAY_ELEMENT                                ~4      ~7
    9    19        INIT_FCALL                                               'substr'
         20        FETCH_DIM_R                                      ~8      !0, 'middle_name'
         21        SEND_VAL                                                 ~8
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $9      
         25        CONCAT                                           ~10     $9, '.'
         26        ADD_ARRAY_ELEMENT                                ~4      ~10
         27        SEND_VAL                                                 ~4
         28        DO_ICALL                                         $11     
         29      > RETURN                                                   $11
   12    30*     > RETURN                                                   null

End of function generateuserfio

Function generateuserfio2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hhNpG
function name:  generateUserFIO2
number of ops:  31
compiled vars:  !0 = $names
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        INIT_FCALL                                               'implode'
   23     2        SEND_VAL                                                 '+'
   25     3        INIT_FCALL                                               'ucfirst'
          4        INIT_FCALL                                               'strtolower'
          5        FETCH_DIM_R                                      ~1      !0, 'last_name'
          6        SEND_VAL                                                 ~1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        INIT_ARRAY                                       ~4      $3
   26    11        INIT_FCALL                                               'substr'
         12        FETCH_DIM_R                                      ~5      !0, 'first_name'
         13        SEND_VAL                                                 ~5
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 2
         16        DO_ICALL                                         $6      
         17        CONCAT                                           ~7      $6, '.'
         18        ADD_ARRAY_ELEMENT                                ~4      ~7
   27    19        INIT_FCALL                                               'substr'
         20        FETCH_DIM_R                                      ~8      !0, 'middle_name'
         21        SEND_VAL                                                 ~8
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 2
         24        DO_ICALL                                         $9      
         25        CONCAT                                           ~10     $9, '.'
         26        ADD_ARRAY_ELEMENT                                ~4      ~10
         27        SEND_VAL                                                 ~4
         28        DO_ICALL                                         $11     
         29      > RETURN                                                   $11
   30    30*     > RETURN                                                   null

End of function generateuserfio2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.24 ms | 1394 KiB | 25 Q