3v4l.org

run code in 500+ 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')) { // 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 = 35
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 24
Branch analysis from position: 11
Branch analysis from position: 9
filename:       /in/Aj8Ef
function name:  (null)
number of ops:  44
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, ->35
   18    25    >   INIT_FCALL_BY_NAME                                           'iconv'
         26        SEND_VAL_EX                                                  'UTF-8'
         27        SEND_VAL_EX                                                  'ASCII%2F%2FTRANSLIT%2F%2FIGNORE'
         28        INIT_FCALL_BY_NAME                                           'transliterator_transliterate'
         29        SEND_VAL_EX                                                  'Any-Latin%3B+Latin-ASCII%3B+Lower%28%29'
         30        SEND_VAR_EX                                                  !0
         31        DO_FCALL                                          0  $12     
         32        SEND_VAR_NO_REF_EX                                           $12
         33        DO_FCALL                                          0  $13     
         34        ASSIGN                                                       !0, $13
   21    35    >   ASSIGN                                                       !1, <array>
   23    36        FRAMELESS_ICALL_3                preg_replace        ~16     !1, ''
         37        OP_DATA                                                      !0
         38        FRAMELESS_ICALL_1                trim                ~17     ~16
         39        ASSIGN                                                       !2, ~17
   25    40        INIT_FCALL                                                   'var_dump'
         41        SEND_VAR                                                     !2
         42        DO_ICALL                                                     
         43      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
238.79 ms | 1996 KiB | 16 Q