3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = mb_convert_encoding('パーティーへ行かないか', 'SJIS', 'UTF-8'); var_dump(mb_check_encoding($string, 'SJIS')); // should be valid var_dump(mb_check_encoding($string, 'Windows-1252')); // should be invalid var_dump(mb_detect_encoding($string, 'SJIS', true)); // should be valid var_dump(mb_detect_encoding($string, 'Windows-1252', true)); // should be invalid var_dump(mb_convert_encoding($string, 'UTF-8', 'SJIS')); // should correct var_dump(mb_convert_encoding($string, 'UTF-8', 'Windows-1252')); // should be wrong
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qg7E1
function name:  (null)
number of ops:  53
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'mb_convert_encoding'
          1        SEND_VAL                                                     '%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%83%BC%E3%81%B8%E8%A1%8C%E3%81%8B%E3%81%AA%E3%81%84%E3%81%8B'
          2        SEND_VAL                                                     'SJIS'
          3        SEND_VAL                                                     'UTF-8'
          4        DO_ICALL                                             $1      
          5        ASSIGN                                                       !0, $1
    4     6        INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'mb_check_encoding'
          8        SEND_VAR                                                     !0
          9        SEND_VAL                                                     'SJIS'
         10        DO_ICALL                                             $3      
         11        SEND_VAR                                                     $3
         12        DO_ICALL                                                     
    5    13        INIT_FCALL                                                   'var_dump'
         14        INIT_FCALL                                                   'mb_check_encoding'
         15        SEND_VAR                                                     !0
         16        SEND_VAL                                                     'Windows-1252'
         17        DO_ICALL                                             $5      
         18        SEND_VAR                                                     $5
         19        DO_ICALL                                                     
    7    20        INIT_FCALL                                                   'var_dump'
         21        INIT_FCALL                                                   'mb_detect_encoding'
         22        SEND_VAR                                                     !0
         23        SEND_VAL                                                     'SJIS'
         24        SEND_VAL                                                     <true>
         25        DO_ICALL                                             $7      
         26        SEND_VAR                                                     $7
         27        DO_ICALL                                                     
    8    28        INIT_FCALL                                                   'var_dump'
         29        INIT_FCALL                                                   'mb_detect_encoding'
         30        SEND_VAR                                                     !0
         31        SEND_VAL                                                     'Windows-1252'
         32        SEND_VAL                                                     <true>
         33        DO_ICALL                                             $9      
         34        SEND_VAR                                                     $9
         35        DO_ICALL                                                     
   10    36        INIT_FCALL                                                   'var_dump'
         37        INIT_FCALL                                                   'mb_convert_encoding'
         38        SEND_VAR                                                     !0
         39        SEND_VAL                                                     'UTF-8'
         40        SEND_VAL                                                     'SJIS'
         41        DO_ICALL                                             $11     
         42        SEND_VAR                                                     $11
         43        DO_ICALL                                                     
   11    44        INIT_FCALL                                                   'var_dump'
         45        INIT_FCALL                                                   'mb_convert_encoding'
         46        SEND_VAR                                                     !0
         47        SEND_VAL                                                     'UTF-8'
         48        SEND_VAL                                                     'Windows-1252'
         49        DO_ICALL                                             $13     
         50        SEND_VAR                                                     $13
         51        DO_ICALL                                                     
         52      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.39 ms | 2802 KiB | 12 Q