3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'ä€'; var_dump(strlen($str)); var_dump(mb_detect_encoding($str, 'auto', true)); $iso = mb_convert_encoding($str, 'iso-8859-1', 'utf-8'); var_dump(strlen($str)); var_dump(mb_detect_encoding($iso, 'utf-8, iso-8859-1', true));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tMn7r
function name:  (null)
number of ops:  32
compiled vars:  !0 = $str, !1 = $iso
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%C3%A4%E2%82%AC'
    5     1        INIT_FCALL                                               'var_dump'
          2        STRLEN                                           ~3      !0
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                                 
    6     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'mb_detect_encoding'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'auto'
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'mb_convert_encoding'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 'iso-8859-1'
         16        SEND_VAL                                                 'utf-8'
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !1, $7
    9    19        INIT_FCALL                                               'var_dump'
         20        STRLEN                                           ~9      !0
         21        SEND_VAL                                                 ~9
         22        DO_ICALL                                                 
   11    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'mb_detect_encoding'
         25        SEND_VAR                                                 !1
         26        SEND_VAL                                                 'utf-8%2C+iso-8859-1'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $11     
         29        SEND_VAR                                                 $11
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.34 ms | 1395 KiB | 19 Q