3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo setlocale(LC_ALL, 0); echo setlocale(LANG, 0); echo setlocale(LC_COLLATE, 0); echo setlocale(LC_NUMERIC, 0); $text = '%&/()"QEm software VaLidation V20ººººº'; $replacementChar = ' '; // replace non Unicode letters or digits by the replacement char $text = preg_replace('/[^\pL\d]+/u', $replacementChar, $text); echo $text."\n"; // trim replacement characters that ended up at the edges $text = trim($text, $replacementChar); // Force conversion to us-ascci, to take care of accented characters // and transliterate replacing unknown characters by a similar one $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); echo $text."\n"; $text = strtolower($text); // Remove unwanted characters due to transliteration // but keep the replacement character $text = preg_replace('/[^'.$replacementChar.'\w]+/', '', $text); echo $text."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m1V1r
function name:  (null)
number of ops:  59
compiled vars:  !0 = $text, !1 = $replacementChar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'setlocale'
          1        SEND_VAL                                                 6
          2        SEND_VAL                                                 0
          3        DO_ICALL                                         $2      
          4        ECHO                                                     $2
    4     5        INIT_FCALL                                               'setlocale'
          6        FETCH_CONSTANT                                   ~3      'LANG'
          7        SEND_VAL                                                 ~3
          8        SEND_VAL                                                 0
          9        DO_ICALL                                         $4      
         10        ECHO                                                     $4
    5    11        INIT_FCALL                                               'setlocale'
         12        SEND_VAL                                                 3
         13        SEND_VAL                                                 0
         14        DO_ICALL                                         $5      
         15        ECHO                                                     $5
    6    16        INIT_FCALL                                               'setlocale'
         17        SEND_VAL                                                 1
         18        SEND_VAL                                                 0
         19        DO_ICALL                                         $6      
         20        ECHO                                                     $6
    8    21        ASSIGN                                                   !0, '%25%26%2F%28%29%22QEm+software+VaLidation+V20%C2%BA%C2%BA%C2%BA%C2%BA%C2%BA'
    9    22        ASSIGN                                                   !1, '+'
   12    23        INIT_FCALL                                               'preg_replace'
         24        SEND_VAL                                                 '%2F%5B%5E%5CpL%5Cd%5D%2B%2Fu'
         25        SEND_VAR                                                 !1
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $9      
         28        ASSIGN                                                   !0, $9
   13    29        CONCAT                                           ~11     !0, '%0A'
         30        ECHO                                                     ~11
   16    31        INIT_FCALL                                               'trim'
         32        SEND_VAR                                                 !0
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $12     
         35        ASSIGN                                                   !0, $12
   20    36        INIT_FCALL_BY_NAME                                       'iconv'
         37        SEND_VAL_EX                                              'utf-8'
         38        SEND_VAL_EX                                              'us-ascii%2F%2FTRANSLIT'
         39        SEND_VAR_EX                                              !0
         40        DO_FCALL                                      0  $14     
         41        ASSIGN                                                   !0, $14
   21    42        CONCAT                                           ~16     !0, '%0A'
         43        ECHO                                                     ~16
   23    44        INIT_FCALL                                               'strtolower'
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                         $17     
         47        ASSIGN                                                   !0, $17
   27    48        INIT_FCALL                                               'preg_replace'
         49        CONCAT                                           ~19     '%2F%5B%5E', !1
         50        CONCAT                                           ~20     ~19, '%5Cw%5D%2B%2F'
         51        SEND_VAL                                                 ~20
         52        SEND_VAL                                                 ''
         53        SEND_VAR                                                 !0
         54        DO_ICALL                                         $21     
         55        ASSIGN                                                   !0, $21
   28    56        CONCAT                                           ~23     !0, '%0A'
         57        ECHO                                                     ~23
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.15 ms | 1010 KiB | 17 Q