3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prepareSlug( $slug ) { $slug = preg_replace( '/[^A-Za-z0-9\s]/', '', $slug ); return trim( str_replace( ' ', '-', $slug ) ); } echo prepareSlug( 'aoin 2. !#$&%/92 \'*?0 ' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8ObJa
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'prepareslug'
          1        SEND_VAL                                                 'aoin++2.+%21%23%24%26%25%2F92+%27%2A%3F0+'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function prepareslug:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8ObJa
function name:  prepareSlug
number of ops:  17
compiled vars:  !0 = $slug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5EA-Za-z0-9%5Cs%5D%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
    6     7        INIT_FCALL                                               'trim'
          8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 '+'
         10        SEND_VAL                                                 '-'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $3      
         13        SEND_VAR                                                 $3
         14        DO_ICALL                                         $4      
         15      > RETURN                                                   $4
    7    16*     > RETURN                                                   null

End of function prepareslug

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.18 ms | 1398 KiB | 20 Q