3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'Premium serviço Personal - 1 mês'; $trunc = substr($input, 0, 32); var_dump($input); var_dump($trunc); var_dump( iconv_substr($input, 0, 32, 'utf8') ); var_dump( htmlspecialchars_decode(htmlspecialchars($trunc, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8'), ENT_NOQUOTES) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m0N7Y
function name:  (null)
number of ops:  35
compiled vars:  !0 = $input, !1 = $trunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Premium+servi%C3%A7o+Personal+-+1+m%C3%AAs'
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 32
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    6     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL_BY_NAME                                       'iconv_substr'
         15        SEND_VAR_EX                                              !0
         16        SEND_VAL_EX                                              0
         17        SEND_VAL_EX                                              32
         18        SEND_VAL_EX                                              'utf8'
         19        DO_FCALL                                      0  $7      
         20        SEND_VAR                                                 $7
         21        DO_ICALL                                                 
   10    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'htmlspecialchars_decode'
         24        INIT_FCALL                                               'htmlspecialchars'
         25        SEND_VAR                                                 !1
         26        SEND_VAL                                                 4
         27        SEND_VAL                                                 'UTF-8'
         28        DO_ICALL                                         $9      
         29        SEND_VAR                                                 $9
         30        SEND_VAL                                                 0
         31        DO_ICALL                                         $10     
         32        SEND_VAR                                                 $10
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.49 ms | 1396 KiB | 21 Q