3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "\x95\xB6\x8E\x9A\x83\x52\x81\x5B\x83\x68"; // Detect character encoding with current detect_order var_dump(mb_detect_encoding($str)); // "auto" is expanded according to mbstring.language var_dump(mb_detect_encoding($str, "auto")); // Specify "encodings" parameter by list separated by comma var_dump(mb_detect_encoding($str, "JIS, eucjp-win, sjis-win")); // Use array to specify "encodings" parameter $encodings = [ "ASCII", "JIS", "EUC-JP" ]; var_dump(mb_detect_encoding($str, $encodings));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rf0FG
function name:  (null)
number of ops:  30
compiled vars:  !0 = $str, !1 = $encodings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%95%B6%8E%9A%83R%81%5B%83h'
    6     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'mb_detect_encoding'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                                 
    9     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'mb_detect_encoding'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 'auto'
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                                 
   12    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'mb_detect_encoding'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 'JIS%2C+eucjp-win%2C+sjis-win'
         18        DO_ICALL                                         $7      
         19        SEND_VAR                                                 $7
         20        DO_ICALL                                                 
   15    21        ASSIGN                                                   !1, <array>
   20    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'mb_detect_encoding'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $10     
         27        SEND_VAR                                                 $10
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.04 ms | 1011 KiB | 15 Q