3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo make_clean_url("اﺻﻠﯽ ﺗﺮﯾﻦ ﻓﺮق اﺳﺘﻌﺎره ﻣﺼﺮﺣﻪ و ﻣﮑﻨﯿﻪ ﭼﯿﺴﺖ؟"); function make_clean_url($url){ $url_word_separator = "-"; // To replace new lines with space $url = preg_replace('/\n+/', " ", $url); // To replace spaces with - $url = preg_replace('/\s+/', "-", $url); // To replace dot(s) with - $url = preg_replace('/\.+/', "-", $url); // To remove html-entitis characters i.e &laquo; $url = preg_replace("/&#?[a-z0-9]+;/i","",$url); // To remove eveything except numbers, dash, number-sign, space and alphabet characters $url = preg_replace('/[^\x{600}-\x{6FF}a-zA-Z0-9 #\-]/u', '', $url); // To trim surrounded spaces and dashs $url = trim($url, " $url_word_separator"); return $url; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OGM15
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'make_clean_url'
          1        SEND_VAL_EX                                              '%D8%A7%EF%BA%BB%EF%BB%A0%EF%AF%BD+%EF%BA%97%EF%BA%AE%EF%AF%BE%EF%BB%A6+%EF%BB%93%EF%BA%AE%D9%82+%D8%A7%EF%BA%B3%EF%BA%98%EF%BB%8C%EF%BA%8E%D8%B1%D9%87+%EF%BB%A3%EF%BA%BC%EF%BA%AE%EF%BA%A3%EF%BB%AA+%D9%88+%EF%BB%A3%EF%AE%91%EF%BB%A8%EF%AF%BF%EF%BB%AA+%EF%AD%BC%EF%AF%BF%EF%BA%B4%EF%BA%96%D8%9F'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   28     4      > RETURN                                                   1

Function make_clean_url:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OGM15
function name:  make_clean_url
number of ops:  41
compiled vars:  !0 = $url, !1 = $url_word_separator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, '-'
   10     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5Cn%2B%2F'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
   13     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         10        SEND_VAL                                                 '-'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !0, $5
   16    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%5C.%2B%2F'
         16        SEND_VAL                                                 '-'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $7      
         19        ASSIGN                                                   !0, $7
   19    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAL                                                 '%2F%26%23%3F%5Ba-z0-9%5D%2B%3B%2Fi'
         22        SEND_VAL                                                 ''
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $9      
         25        ASSIGN                                                   !0, $9
   22    26        INIT_FCALL                                               'preg_replace'
         27        SEND_VAL                                                 '%2F%5B%5E%5Cx%7B600%7D-%5Cx%7B6FF%7Da-zA-Z0-9+%23%5C-%5D%2Fu'
         28        SEND_VAL                                                 ''
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $11     
         31        ASSIGN                                                   !0, $11
   25    32        INIT_FCALL                                               'trim'
         33        SEND_VAR                                                 !0
         34        NOP                                                      
         35        FAST_CONCAT                                      ~13     '+', !1
         36        SEND_VAL                                                 ~13
         37        DO_ICALL                                         $14     
         38        ASSIGN                                                   !0, $14
   27    39      > RETURN                                                   !0
   28    40*     > RETURN                                                   null

End of function make_clean_url

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.97 ms | 1006 KiB | 15 Q