3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tagify($text, $spacer = '-') { //Handle if array if (is_array($text)) { return array_map("tagify", $text); } $text = str_replace('&', 'and', $text); return str_replace(' ', $spacer, trim(preg_replace('#([^a-z0-9/]+)#', ' ', strtolower($text)))); } var_dump(tagify(['something else', 'per che']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/os8np
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'tagify'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function tagify:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/os8np
function name:  tagify
number of ops:  33
compiled vars:  !0 = $text, !1 = $spacer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      '-'
    7     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~2, ->9
    9     4    >   INIT_FCALL                                               'array_map'
          5        SEND_VAL                                                 'tagify'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
   12     9    >   INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 '%26'
         11        SEND_VAL                                                 'and'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $4      
         14        ASSIGN                                                   !0, $4
   14    15        INIT_FCALL                                               'str_replace'
         16        SEND_VAL                                                 '+'
         17        SEND_VAR                                                 !1
         18        INIT_FCALL                                               'trim'
         19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAL                                                 '%23%28%5B%5Ea-z0-9%2F%5D%2B%29%23'
         21        SEND_VAL                                                 '+'
         22        INIT_FCALL                                               'strtolower'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $6      
         25        SEND_VAR                                                 $6
         26        DO_ICALL                                         $7      
         27        SEND_VAR                                                 $7
         28        DO_ICALL                                         $8      
         29        SEND_VAR                                                 $8
         30        DO_ICALL                                         $9      
         31      > RETURN                                                   $9
   15    32*     > RETURN                                                   null

End of function tagify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.31 ms | 1403 KiB | 26 Q