3v4l.org

run code in 500+ 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:  19
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        FRAMELESS_ICALL_3                str_replace         ~3      '%26', '+'
          6        OP_DATA                                                      !0
          7        ASSIGN                                                       !0, ~3
    6     8        FRAMELESS_ICALL_3                preg_replace        ~5      '%2F%5B%5E%5Cw%5Cs-%5D%2B%2Fu', '+'
          9        OP_DATA                                                      !0
         10        ASSIGN                                                       !0, ~5
    7    11        FRAMELESS_ICALL_3                preg_replace        ~7      '%2F%5B%5Cs-%5D%2B%2Fu', '+'
         12        OP_DATA                                                      !0
         13        ASSIGN                                                       !0, ~7
    8    14        FRAMELESS_ICALL_3                preg_replace        ~9      '%2F%5B%5Cs_%5D%2B%2Fu', '-'
         15        OP_DATA                                                      !0
         16        ASSIGN                                                       !0, ~9
    9    17      > RETURN                                                       !0
   10    18*     > RETURN                                                       null

End of function seourl

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
134.77 ms | 2035 KiB | 16 Q