3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = 'ыыыыыыыы'; if (function_exists('transliterator_transliterate') && function_exists('iconv')) { echo 'ICONV Available' .PHP_EOL; } // Remove any trailing dots, as those aren't ever valid file names. $file = rtrim($file, '.'); // Try transliterating the file name using the native php function if (function_exists('transliterator_transliterate') && function_exists('iconv')) { echo 'transliterating YES' .PHP_EOL; // Using iconv to ignore characters that can't be transliterated $file = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', $file)); } $regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#'); $name = trim(preg_replace($regex, '', $file)); var_dump($name);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 36
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 24
Branch analysis from position: 11
Branch analysis from position: 9
filename:       /in/BRcNa
function name:  (null)
number of ops:  50
compiled vars:  !0 = $file, !1 = $regex, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%D1%8B%D1%8B%D1%8B%D1%8B%D1%8B%D1%8B%D1%8B%D1%8B'
    5     1        INIT_FCALL                                               'function_exists'
          2        SEND_VAL                                                 'transliterator_transliterate'
          3        DO_ICALL                                         $4      
          4      > JMPZ_EX                                          ~5      $4, ->9
          5    >   INIT_FCALL                                               'function_exists'
          6        SEND_VAL                                                 'iconv'
          7        DO_ICALL                                         $6      
          8        BOOL                                             ~5      $6
          9    > > JMPZ                                                     ~5, ->11
    7    10    >   ECHO                                                     'ICONV+Available%0A'
   12    11    >   INIT_FCALL                                               'rtrim'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 '.'
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !0, $7
   15    16        INIT_FCALL                                               'function_exists'
         17        SEND_VAL                                                 'transliterator_transliterate'
         18        DO_ICALL                                         $9      
         19      > JMPZ_EX                                          ~10     $9, ->24
         20    >   INIT_FCALL                                               'function_exists'
         21        SEND_VAL                                                 'iconv'
         22        DO_ICALL                                         $11     
         23        BOOL                                             ~10     $11
         24    > > JMPZ                                                     ~10, ->36
   17    25    >   ECHO                                                     'transliterating+YES%0A'
   19    26        INIT_FCALL_BY_NAME                                       'iconv'
         27        SEND_VAL_EX                                              'UTF-8'
         28        SEND_VAL_EX                                              'ASCII%2F%2FTRANSLIT%2F%2FIGNORE'
         29        INIT_FCALL_BY_NAME                                       'transliterator_transliterate'
         30        SEND_VAL_EX                                              'Any-Latin%3B+Latin-ASCII%3B+Lower%28%29'
         31        SEND_VAR_EX                                              !0
         32        DO_FCALL                                      0  $12     
         33        SEND_VAR_NO_REF_EX                                       $12
         34        DO_FCALL                                      0  $13     
         35        ASSIGN                                                   !0, $13
   22    36    >   ASSIGN                                                   !1, <array>
   24    37        INIT_FCALL                                               'trim'
         38        INIT_FCALL                                               'preg_replace'
         39        SEND_VAR                                                 !1
         40        SEND_VAL                                                 ''
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                         $16     
         43        SEND_VAR                                                 $16
         44        DO_ICALL                                         $17     
         45        ASSIGN                                                   !2, $17
   26    46        INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !2
         48        DO_ICALL                                                 
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.33 ms | 1011 KiB | 18 Q