3v4l.org

run code in 300+ PHP versions simultaneously
<?php function slugify($string) { $string = transliterator_transliterate("Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();", $string); $string = preg_replace('/[-\s]+/', '-', $string); return trim($string, '-'); } print_r(slugify('olá'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VVhfj
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'slugify'
          2        SEND_VAL                                                 'ol%C3%A1'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function slugify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VVhfj
function name:  slugify
number of ops:  18
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL_BY_NAME                                       'transliterator_transliterate'
          2        SEND_VAL_EX                                              'Any-Latin%3B+Latin-ASCII%3B+NFD%3B+%5B%3ANonspacing+Mark%3A%5D+Remove%3B+NFC%3B+%5B%3APunctuation%3A%5D+Remove%3B+Lower%28%29%3B'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $1      
          5        ASSIGN                                                   !0, $1
    5     6        INIT_FCALL                                               'preg_replace'
          7        SEND_VAL                                                 '%2F%5B-%5Cs%5D%2B%2F'
          8        SEND_VAL                                                 '-'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        ASSIGN                                                   !0, $3
    6    12        INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 '-'
         15        DO_ICALL                                         $5      
         16      > RETURN                                                   $5
    7    17*     > RETURN                                                   null

End of function slugify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163 ms | 1398 KiB | 23 Q