3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prepareKeywordsForDatabase($string) { $keywords = preg_split('#[\,|\v]#', $string); $keywords = array_map('trim', $keywords); $array = array(); foreach ($keywords as $k) { if ($k == '') { continue; } $array[] = $k; } return implode('.', $array); } echo prepareKeywordsForDatabase('ciao, come , , , , va ?!! !!');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vOv9T
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     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
   23     4      > RETURN                                                   1

Function preparekeywordsfordatabase:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/vOv9T
function name:  prepareKeywordsForDatabase
number of ops:  27
compiled vars:  !0 = $string, !1 = $keywords, !2 = $array, !3 = $k
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                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'trim'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    6    11        ASSIGN                                                   !2, <array>
    7    12      > FE_RESET_R                                       $9      !1, ->20
         13    > > FE_FETCH_R                                               $9, !3, ->20
    8    14    >   IS_EQUAL                                                 !3, ''
         15      > JMPZ                                                     ~10, ->17
    9    16    > > JMP                                                      ->13
   12    17    >   ASSIGN_DIM                                               !2
         18        OP_DATA                                                  !3
    7    19      > JMP                                                      ->13
         20    >   FE_FREE                                                  $9
   15    21        INIT_FCALL                                               'implode'
         22        SEND_VAL                                                 '.'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $12     
         25      > RETURN                                                   $12
   16    26*     > RETURN                                                   null

End of function preparekeywordsfordatabase

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
207.09 ms | 1402 KiB | 20 Q