3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exclude = 'BASE64,UUENCODE,HTML-ENTITIES,Quoted-Printable,' . '7bit,8bit,pass,wchar,byte2be,byte2le,byte4be,byte4le,' . 'UCS-4,UCS-4BE,UCS-4LE,UCS-2,UCS-2BE,UCS-2LE'; $prio = [ 'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'WINDOWS-1252', 'WINDOWS-1251', 'WINDOWS-1254', 'EUC-JP', 'EUC-TW', 'KOI8-R', 'BIG-5', 'ISO-2022-KR', 'ISO-2022-JP', 'GB18030', ]; $all_encodings = array_diff(mb_list_encodings(), explode(',', $exclude)); $encodings = array_unique(array_merge($prio, $all_encodings)); $test = 'Iksi' . chr(241) . 'ski'; echo mb_detect_encoding($test, $encodings);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9o7ft
function name:  (null)
number of ops:  28
compiled vars:  !0 = $exclude, !1 = $prio, !2 = $all_encodings, !3 = $encodings, !4 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'BASE64%2CUUENCODE%2CHTML-ENTITIES%2CQuoted-Printable%2C7bit%2C8bit%2Cpass%2Cwchar%2Cbyte2be%2Cbyte2le%2Cbyte4be%2Cbyte4le%2CUCS-4%2CUCS-4BE%2CUCS-4LE%2CUCS-2%2CUCS-2BE%2CUCS-2LE'
    6     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'array_diff'
          3        INIT_FCALL                                               'mb_list_encodings'
          4        DO_ICALL                                         $7      
          5        SEND_VAR                                                 $7
          6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%2C'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
   17    13        INIT_FCALL                                               'array_unique'
         14        INIT_FCALL                                               'array_merge'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !3, $12
   19    21        ASSIGN                                                   !4, 'Iksi%F1ski'
   21    22        INIT_FCALL                                               'mb_detect_encoding'
         23        SEND_VAR                                                 !4
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                         $15     
         26        ECHO                                                     $15
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.79 ms | 1400 KiB | 25 Q