3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = ' Namnet på bildtävlingen nº1@2020-`24...like&share'; $slug = \Transliterator::createFromRules(" :: Any-Latin; :: NFD; :: [:Mn:] Remove; :: NFKC; :: Latin-ASCII; :: Lower(); ^[^[:Ll:][:Nd:]]+ > ; [^[:Ll:][:Nd:]]+$ > ; [^[:Ll:][:Nd:]]+ > '-'; ")->transliterate($string); $slug = preg_replace(['/[^a-z0-9-]+/', '/^-+|(?<=-)-+|-+$/'], '', $slug); $slugPrev = \Transliterator::createFromRules(" :: Any-Latin; :: NFD; :: [:Nonspacing Mark:] Remove; :: NFC; :: [^-[:^Punctuation:]] Remove; :: Lower(); [:^L:] { [-] > ; [-] } [:^L:] > ; [-[:Separator:]]+ > '-'; ")->transliterate($string); echo "$slugPrev -> $slug";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vtJiH
function name:  (null)
number of ops:  23
compiled vars:  !0 = $string, !1 = $slug, !2 = $slugPrev
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '+Namnet+p%C3%A5+bildt%C3%A4vlingen+n%C2%BA1%402020-%6024...like%26share'
    5     1        INIT_STATIC_METHOD_CALL                                      'Transliterator', 'createFromRules'
          2        SEND_VAL_EX                                                  '%0A%09%3A%3A+Any-Latin%3B%0A%09%3A%3A+NFD%3B%0A%09%3A%3A+%5B%3AMn%3A%5D+Remove%3B%0A%09%3A%3A+NFKC%3B%0A%09%3A%3A+Latin-ASCII%3B%0A%09%3A%3A+Lower%28%29%3B%0A%09%5E%5B%5E%5B%3ALl%3A%5D%5B%3ANd%3A%5D%5D%2B+%3E+%3B%0A%09%5B%5E%5B%3ALl%3A%5D%5B%3ANd%3A%5D%5D%2B%24+%3E+%3B%0A%09%5B%5E%5B%3ALl%3A%5D%5B%3ANd%3A%5D%5D%2B+%3E+%27-%27%3B%0A'
          3        DO_FCALL                                          0  $4      
   15     4        INIT_METHOD_CALL                                             $4, 'transliterate'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $5      
    5     7        ASSIGN                                                       !1, $5
   17     8        FRAMELESS_ICALL_3                preg_replace        ~7      <array>, ''
          9        OP_DATA                                                      !1
         10        ASSIGN                                                       !1, ~7
   19    11        INIT_STATIC_METHOD_CALL                                      'Transliterator', 'createFromRules'
         12        SEND_VAL_EX                                                  '%0A++++%3A%3A+Any-Latin%3B%0A++++%3A%3A+NFD%3B%0A++++%3A%3A+%5B%3ANonspacing+Mark%3A%5D+Remove%3B%0A++++%3A%3A+NFC%3B%0A++++%3A%3A+%5B%5E-%5B%3A%5EPunctuation%3A%5D%5D+Remove%3B%0A++++%3A%3A+Lower%28%29%3B%0A++++%5B%3A%5EL%3A%5D+%7B+%5B-%5D+%3E+%3B%0A++++%5B-%5D+%7D+%5B%3A%5EL%3A%5D+%3E+%3B%0A++++%5B-%5B%3ASeparator%3A%5D%5D%2B+%3E+%27-%27%3B%0A'
         13        DO_FCALL                                          0  $9      
   29    14        INIT_METHOD_CALL                                             $9, 'transliterate'
         15        SEND_VAR_EX                                                  !0
         16        DO_FCALL                                          0  $10     
   19    17        ASSIGN                                                       !2, $10
   31    18        ROPE_INIT                                         3  ~13     !2
         19        ROPE_ADD                                          1  ~13     ~13, '+-%3E+'
         20        ROPE_END                                          2  ~12     ~13, !1
         21        ECHO                                                         ~12
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.52 ms | 3353 KiB | 13 Q