3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'Zoë'; var_dump(substr($string, -1)); var_dump(mb_substr($string, -1)); var_dump(grapheme_substr($string, -1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IMoWQ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Zoe%CC%88'
    5     1        INIT_FCALL                                                   'var_dump'
          2        FRAMELESS_ICALL_2                substr              ~2      !0, -1
          3        SEND_VAL                                                     ~2
          4        DO_ICALL                                                     
    6     5        INIT_FCALL                                                   'var_dump'
          6        INIT_FCALL                                                   'mb_substr'
          7        SEND_VAR                                                     !0
          8        SEND_VAL                                                     -1
          9        DO_ICALL                                             $4      
         10        SEND_VAR                                                     $4
         11        DO_ICALL                                                     
    7    12        INIT_FCALL                                                   'var_dump'
         13        INIT_FCALL_BY_NAME                                           'grapheme_substr'
         14        SEND_VAR_EX                                                  !0
         15        SEND_VAL_EX                                                  -1
         16        DO_FCALL                                          0  $6      
         17        SEND_VAR                                                     $6
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
213.33 ms | 2002 KiB | 15 Q