3v4l.org

run code in 300+ PHP versions simultaneously
<?php function slugify($text) { $text = trim($text); $text = strtr( utf8_decode($text), "\xe1\xc1\xe0\xc0\xe2\xc2\xe4\xc4\xe3\xc3\xe5\xc5" . "\xaa\xe7\xc7\xe9\xc9\xe8\xc8\xea\xca\xeb\xcb\xed" . "\xcd\xec\xcc\xee\xce\xef\xcf\xf1\xd1\xf3\xd3\xf2" . "\xd2\xf4\xd4\xf6\xd6\xf5\xd5\x8\xd8\xba\xf0\xfa\xda" . "\xf9\xd9\xfb\xdb\xfc\xdc\xfd\xdd\xff\xe6\xc6\xdf\xf8", "aAaAaAaAaAaAacCeEeEeEeEiIiIiIiInNo" . "OoOoOoOoOoOoouUuUuUuUyYyaAso" ); $text = preg_replace('![^a-z0-9]!i', ' ', $text); $text = preg_replace('!\s{2,}!', ' ', $text); $text = preg_replace('!\s!', '_', $text); return $text; } for($i=0;$i<=10;$i++) slugify( '"6รจ1es(r51-_dih56bs1z"6bt' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 2
Branch analysis from position: 8
Branch analysis from position: 2
filename:       /in/krEQ5
function name:  (null)
number of ops:  9
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->6
   37     2    >   INIT_FCALL                                               'slugify'
          3        SEND_VAL                                                 '%226%C3%A81es%28r51-_dih56bs1z%226bt'
          4        DO_FCALL                                      0          
   36     5        PRE_INC                                                  !0
          6    >   IS_SMALLER_OR_EQUAL                                      !0, 10
          7      > JMPNZ                                                    ~4, ->2
   37     8    > > RETURN                                                   1

Function slugify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/krEQ5
function name:  slugify
number of ops:  34
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    8     5        INIT_FCALL                                               'strtr'
   10     6        INIT_FCALL                                               'utf8_decode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
   18    10        SEND_VAL                                                 '%E1%C1%E0%C0%E2%C2%E4%C4%E3%C3%E5%C5%AA%E7%C7%E9%C9%E8%C8%EA%CA%EB%CB%ED%CD%EC%CC%EE%CE%EF%CF%F1%D1%F3%D3%F2%D2%F4%D4%F6%D6%F5%D5%08%D8%BA%F0%FA%DA%F9%D9%FB%DB%FC%DC%FD%DD%FF%E6%C6%DF%F8'
   20    11        SEND_VAL                                                 'aAaAaAaAaAaAacCeEeEeEeEiIiIiIiInNoOoOoOoOoOoOoouUuUuUuUyYyaAso'
         12        DO_ICALL                                         $4      
    8    13        ASSIGN                                                   !0, $4
   24    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%21%5B%5Ea-z0-9%5D%21i'
         16        SEND_VAL                                                 '+'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $6      
         19        ASSIGN                                                   !0, $6
   26    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAL                                                 '%21%5Cs%7B2%2C%7D%21'
         22        SEND_VAL                                                 '+'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $8      
         25        ASSIGN                                                   !0, $8
   28    26        INIT_FCALL                                               'preg_replace'
         27        SEND_VAL                                                 '%21%5Cs%21'
         28        SEND_VAL                                                 '_'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $10     
         31        ASSIGN                                                   !0, $10
   32    32      > RETURN                                                   !0
   34    33*     > RETURN                                                   null

End of function slugify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.51 ms | 1402 KiB | 22 Q