3v4l.org

run code in 300+ PHP versions simultaneously
<?php function seoUrl($string) { $string = mb_strtolower($string); $string = str_replace('&',' ',$string); $string = preg_replace("/[^\w\s-]+/u", " ", $string); $string = preg_replace("/[\s-]+/u", " ", $string); $string = preg_replace("/[\s_]+/u", "-", $string); return $string; } echo seoUrl("Test--++_-__-Test----Test$#%#Test") . PHP_EOL; echo seoUrl("مرحبا--++_-__مرحباt--مرحباst$#%#مرحبا") . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8tcop
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'seourl'
          1        SEND_VAL                                                 'Test--%2B%2B_-__-Test----Test%24%23%25%23Test'
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%0A'
          4        ECHO                                                     ~1
   13     5        INIT_FCALL                                               'seourl'
          6        SEND_VAL                                                 '%D9%85%D8%B1%D8%AD%D8%A8%D8%A7--%2B%2B_-__%D9%85%D8%B1%D8%AD%D8%A8%D8%A7t--%D9%85%D8%B1%D8%AD%D8%A8%D8%A7st%24%23%25%23%D9%85%D8%B1%D8%AD%D8%A8%D8%A7'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      $2, '%0A'
          9        ECHO                                                     ~3
   14    10      > RETURN                                                   1

Function seourl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8tcop
function name:  seoUrl
number of ops:  31
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'mb_strtolower'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    5     5        INIT_FCALL                                               'str_replace'
          6        SEND_VAL                                                 '%26'
          7        SEND_VAL                                                 '+'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10        ASSIGN                                                   !0, $3
    6    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%5B%5E%5Cw%5Cs-%5D%2B%2Fu'
         13        SEND_VAL                                                 '+'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $5      
         16        ASSIGN                                                   !0, $5
    7    17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2F%5B%5Cs-%5D%2B%2Fu'
         19        SEND_VAL                                                 '+'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $7      
         22        ASSIGN                                                   !0, $7
    8    23        INIT_FCALL                                               'preg_replace'
         24        SEND_VAL                                                 '%2F%5B%5Cs_%5D%2B%2Fu'
         25        SEND_VAL                                                 '-'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $9      
         28        ASSIGN                                                   !0, $9
    9    29      > RETURN                                                   !0
   10    30*     > RETURN                                                   null

End of function seourl

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
223.41 ms | 1020 KiB | 18 Q