3v4l.org

run code in 500+ PHP versions simultaneously
<?php function slugify(string $input): string { $translitRules = [ ":: Any-Latin", ":: [:Nonspacing Mark:] Remove", ":: [:Punctuation:] Remove", ":: [:Symbol:] Remove", ":: Latin-ASCII", ":: Lower()", "' ' {' '} > ", "::NULL", "[:Separator:] > '-'", ]; $transliterator = \Transliterator::createFromRules( implode(';', $translitRules) ); return $transliterator->transliterate($input); } $title = '<?php François😎: _+ / Стравинский`😜.'; $slug = slugify($title); var_dump($slug);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hr0iJ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $title, !1 = $slug
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                                       !0, '%3C%3Fphp+Fran%C3%A7ois%F0%9F%98%8E%3A+_%2B+%2F+%D0%A1%D1%82%D1%80%D0%B0%D0%B2%D0%B8%D0%BD%D1%81%D0%BA%D0%B8%D0%B9%60%F0%9F%98%9C.'
   22     1        INIT_FCALL                                                   'slugify'
          2        SEND_VAR                                                     !0
          3        DO_FCALL                                          0  $3      
          4        ASSIGN                                                       !1, $3
   23     5        INIT_FCALL                                                   'var_dump'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                                     
          8      > RETURN                                                       1

Function slugify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hr0iJ
function name:  slugify
number of ops:  14
compiled vars:  !0 = $input, !1 = $translitRules, !2 = $transliterator
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, <array>
   15     2        INIT_STATIC_METHOD_CALL                                      'Transliterator', 'createFromRules'
   16     3        FRAMELESS_ICALL_2                implode             ~4      '%3B', !1
          4        SEND_VAL_EX                                                  ~4
   15     5        DO_FCALL                                          0  $5      
          6        ASSIGN                                                       !2, $5
   18     7        INIT_METHOD_CALL                                             !2, 'transliterate'
          8        SEND_VAR_EX                                                  !0
          9        DO_FCALL                                          0  $7      
         10        VERIFY_RETURN_TYPE                                           $7
         11      > RETURN                                                       $7
   19    12*       VERIFY_RETURN_TYPE                                           
         13*     > RETURN                                                       null

End of function slugify

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.34 ms | 2158 KiB | 15 Q