3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "آزمون پادشاهی متحده"; $pattern = '/[`~!@#$%^&*()_|+=?;:..’“\'"<>,€£¥•،٫؟»«{}[\]\\\\\/]+/ui'; $replacement = ''; $slug = trim(preg_replace($pattern, $replacement, $string)); $slug = str_replace(" ","-",$slug); echo $slug;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YUsQs
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string, !1 = $pattern, !2 = $replacement, !3 = $slug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%D8%A2%D8%B2%D9%85%D9%88%D9%86+%D9%BE%D8%A7%D8%AF%D8%B4%D8%A7%D9%87%DB%8C+%D9%85%D8%AA%D8%AD%D8%AF%D9%87'
    4     1        ASSIGN                                                   !1, '%2F%5B%60%7E%21%40%23%24%25%5E%26%2A%28%29_%7C%2B%3D%3F%3B%3A..%E2%80%99%E2%80%9C%27%22%3C%3E%2C%E2%82%AC%C2%A3%C2%A5%E2%80%A2%D8%8C%D9%AB%D8%9F%C2%BB%C2%AB%7B%7D%5B%5C%5D%5C%5C%5C%2F%5D%2B%2Fui'
    5     2        ASSIGN                                                   !2, ''
    7     3        INIT_FCALL                                               'trim'
          4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
    8    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAL                                                 '+'
         14        SEND_VAL                                                 '-'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
    9    18        ECHO                                                     !3
   10    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.46 ms | 1399 KiB | 19 Q