3v4l.org

run code in 300+ 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:  17
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        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%3B'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        SEND_VAR_NO_REF_EX                                       $4
   15     8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !2, $5
   18    10        INIT_METHOD_CALL                                         !2, 'transliterate'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $7      
         13        VERIFY_RETURN_TYPE                                       $7
         14      > RETURN                                                   $7
   19    15*       VERIFY_RETURN_TYPE                                       
         16*     > RETURN                                                   null

End of function slugify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.26 ms | 1447 KiB | 16 Q