3v4l.org

run code in 300+ PHP versions simultaneously
<?php function initials($str) { $ret = ''; $proibidos = ['de', 'da','das','do']; $word = explode(' ', $str); foreach ($word as $w) { if(!in_array($w,$proibidos)){ $ret .= strtoupper($w[0]); } } return $ret; } echo initials('igor carvalho de paula');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B6DS3
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'initials'
          1        SEND_VAL                                                 'igor+carvalho+de+paula'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function initials:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/B6DS3
function name:  initials
number of ops:  25
compiled vars:  !0 = $str, !1 = $ret, !2 = $proibidos, !3 = $word, !4 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    7     2        ASSIGN                                                   !2, <array>
    8     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !3, $7
   10     8      > FE_RESET_R                                       $9      !3, ->22
          9    > > FE_FETCH_R                                               $9, !4, ->22
   12    10    >   INIT_FCALL                                               'in_array'
         11        SEND_VAR                                                 !4
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $10     
         14        BOOL_NOT                                         ~11     $10
         15      > JMPZ                                                     ~11, ->21
   13    16    >   INIT_FCALL                                               'strtoupper'
         17        FETCH_DIM_R                                      ~12     !4, 0
         18        SEND_VAL                                                 ~12
         19        DO_ICALL                                         $13     
         20        ASSIGN_OP                                     8          !1, $13
   10    21    > > JMP                                                      ->9
         22    >   FE_FREE                                                  $9
   17    23      > RETURN                                                   !1
   18    24*     > RETURN                                                   null

End of function initials

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.56 ms | 1403 KiB | 20 Q