3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'あaいb'; $bytes_length = 10; $encoding = "ISO-2022-JP"; $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding()); $cut_str = mb_strcut($converted_str, 0, $bytes_length, $encoding); $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding); var_dump($reconverted_str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FaVWR
function name:  (null)
number of ops:  30
compiled vars:  !0 = $input, !1 = $bytes_length, !2 = $encoding, !3 = $converted_str, !4 = $cut_str, !5 = $reconverted_str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%E3%81%82a%E3%81%84b'
    3     1        ASSIGN                                                   !1, 10
    4     2        ASSIGN                                                   !2, 'ISO-2022-JP'
    5     3        INIT_FCALL                                               'mb_convert_encoding'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        INIT_FCALL                                               'mb_internal_encoding'
          7        DO_ICALL                                         $9      
          8        SEND_VAR                                                 $9
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !3, $10
    6    11        INIT_FCALL                                               'mb_strcut'
         12        SEND_VAR                                                 !3
         13        SEND_VAL                                                 0
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !4, $12
    7    18        INIT_FCALL                                               'mb_convert_encoding'
         19        SEND_VAR                                                 !4
         20        INIT_FCALL                                               'mb_internal_encoding'
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $15     
         25        ASSIGN                                                   !5, $15
    8    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !5
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.95 ms | 1001 KiB | 17 Q