3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prepareKeywordsForDatabase($string) { $keywords = preg_split('#[\,|\v]#', $string); $keywords = array_map('trim', $keywords); 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/L1HHQ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     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
   15     4      > RETURN                                                   1

Function preparekeywordsfordatabase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L1HHQ
function name:  prepareKeywordsForDatabase
number of ops:  17
compiled vars:  !0 = $string, !1 = $keywords
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                                         $2      
          5        ASSIGN                                                   !1, $2
    5     6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'trim'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !1, $4
    7    11        INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 '%2C+'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $6      
         15      > RETURN                                                   $6
    8    16*     > RETURN                                                   null

End of function preparekeywordsfordatabase

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.8 ms | 1397 KiB | 20 Q