3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(mb_strlen(iconv('utf-8', 'utf-16le', 'A B C')) / 2); # correct var_dump(mb_strlen(iconv('utf-8', 'utf-16le', '🎖')) / 2); # correct var_dump(bin2hex(mb_convert_encoding('A B C', 'UTF-32BE', 'UTF-8'))); # off by 5 chars var_dump(mb_strlen(mb_convert_encoding('🎖', 'UTF-32BE', 'UTF-8')) / 2); # correct
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8KfQF
function name:  (null)
number of ops:  48
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'mb_strlen'
          2        INIT_FCALL_BY_NAME                                       'iconv'
          3        SEND_VAL_EX                                              'utf-8'
          4        SEND_VAL_EX                                              'utf-16le'
          5        SEND_VAL_EX                                              'A+B+C'
          6        DO_FCALL                                      0  $0      
          7        SEND_VAR                                                 $0
          8        DO_ICALL                                         $1      
          9        DIV                                              ~2      $1, 2
         10        SEND_VAL                                                 ~2
         11        DO_ICALL                                                 
    5    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'mb_strlen'
         14        INIT_FCALL_BY_NAME                                       'iconv'
         15        SEND_VAL_EX                                              'utf-8'
         16        SEND_VAL_EX                                              'utf-16le'
         17        SEND_VAL_EX                                              '%F0%9F%8E%96'
         18        DO_FCALL                                      0  $4      
         19        SEND_VAR                                                 $4
         20        DO_ICALL                                         $5      
         21        DIV                                              ~6      $5, 2
         22        SEND_VAL                                                 ~6
         23        DO_ICALL                                                 
    9    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'bin2hex'
         26        INIT_FCALL                                               'mb_convert_encoding'
         27        SEND_VAL                                                 'A+B+C'
         28        SEND_VAL                                                 'UTF-32BE'
         29        SEND_VAL                                                 'UTF-8'
         30        DO_ICALL                                         $8      
         31        SEND_VAR                                                 $8
         32        DO_ICALL                                         $9      
         33        SEND_VAR                                                 $9
         34        DO_ICALL                                                 
   10    35        INIT_FCALL                                               'var_dump'
         36        INIT_FCALL                                               'mb_strlen'
         37        INIT_FCALL                                               'mb_convert_encoding'
         38        SEND_VAL                                                 '%F0%9F%8E%96'
         39        SEND_VAL                                                 'UTF-32BE'
         40        SEND_VAL                                                 'UTF-8'
         41        DO_ICALL                                         $11     
         42        SEND_VAR                                                 $11
         43        DO_ICALL                                         $12     
         44        DIV                                              ~13     $12, 2
         45        SEND_VAL                                                 ~13
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.67 ms | 1400 KiB | 21 Q