3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prepareKeywordsForDatabase($string) { $keywords = preg_split('#[\,|\v]#', $string); $keywords = array_map('trim', $keywords); for ($i = 0; $i < count($keywords); ++$i) { if ($keywords[$i] == '') { unset($keywords[$i]); } } return implode('.', $keywords); } echo prepareKeywordsForDatabase('ciao, come , , , , va ?!! !!');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CtuFZ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'preparekeywordsfordatabase'
          1        SEND_VAL                                                 'ciao%2C%0A%0Acome+%2C+%2C+%2C+%2C+va+%3F%21%21%0A%0A%21%21'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   20     4      > RETURN                                                   1

Function preparekeywordsfordatabase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 13
Branch analysis from position: 21
Branch analysis from position: 13
Branch analysis from position: 17
filename:       /in/CtuFZ
function name:  prepareKeywordsForDatabase
number of ops:  27
compiled vars:  !0 = $string, !1 = $keywords, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%23%5B%5C%2C%7C%5Cv%5D%23'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    5     6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'trim'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
    6    11        ASSIGN                                                   !2, 0
         12      > JMP                                                      ->18
    7    13    >   FETCH_DIM_R                                      ~8      !1, !2
         14        IS_EQUAL                                                 ~8, ''
         15      > JMPZ                                                     ~9, ->17
    8    16    >   UNSET_DIM                                                !1, !2
    6    17    >   PRE_INC                                                  !2
         18    >   COUNT                                            ~11     !1
         19        IS_SMALLER                                               !2, ~11
         20      > JMPNZ                                                    ~12, ->13
   12    21    >   INIT_FCALL                                               'implode'
         22        SEND_VAL                                                 '.'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $13     
         25      > RETURN                                                   $13
   13    26*     > RETURN                                                   null

End of function preparekeywordsfordatabase

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.75 ms | 1398 KiB | 20 Q