3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = hex2bin('e58da0e6a5bc'); $str2 = hex2bin('d5bcc2a5'); var_dump(mb_detect_encoding($str1, 'CP936', true)); var_dump(mb_detect_encoding($str1, 'EUC-CN', true)); var_dump(mb_detect_encoding($str1, 'UTF-8', true)); var_dump(mb_detect_encoding($str2, 'CP936', true)); var_dump(mb_detect_encoding($str2, 'EUC-CN', true)); var_dump(mb_detect_encoding($str2, 'UTF-8', true));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rEcG5
function name:  (null)
number of ops:  57
compiled vars:  !0 = $str1, !1 = $str2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'hex2bin'
          1        SEND_VAL                                                 'e58da0e6a5bc'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    4     4        INIT_FCALL                                               'hex2bin'
          5        SEND_VAL                                                 'd5bcc2a5'
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
    5     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'mb_detect_encoding'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'CP936'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
    6    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'mb_detect_encoding'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'EUC-CN'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                                 
    7    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'mb_detect_encoding'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 'UTF-8'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $10     
         30        SEND_VAR                                                 $10
         31        DO_ICALL                                                 
    8    32        INIT_FCALL                                               'var_dump'
         33        INIT_FCALL                                               'mb_detect_encoding'
         34        SEND_VAR                                                 !1
         35        SEND_VAL                                                 'CP936'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $12     
         38        SEND_VAR                                                 $12
         39        DO_ICALL                                                 
    9    40        INIT_FCALL                                               'var_dump'
         41        INIT_FCALL                                               'mb_detect_encoding'
         42        SEND_VAR                                                 !1
         43        SEND_VAL                                                 'EUC-CN'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $14     
         46        SEND_VAR                                                 $14
         47        DO_ICALL                                                 
   10    48        INIT_FCALL                                               'var_dump'
         49        INIT_FCALL                                               'mb_detect_encoding'
         50        SEND_VAR                                                 !1
         51        SEND_VAL                                                 'UTF-8'
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $16     
         54        SEND_VAR                                                 $16
         55        DO_ICALL                                                 
         56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.94 ms | 1400 KiB | 19 Q