3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(substr('FooBar', 42)); var_dump(substr('FooBar', -42, 3)); var_dump(substr('FooBar', 42, 3)); var_dump(mb_substr('FooBar', 42, 3)); var_dump(iconv_substr('FooBar', 42, 3)); var_dump(grapheme_substr('FooBar', 42, 3));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3H05i
function name:  (null)
number of ops:  48
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'substr'
          2        SEND_VAL                                                 'FooBar'
          3        SEND_VAL                                                 42
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'substr'
          9        SEND_VAL                                                 'FooBar'
         10        SEND_VAL                                                 -42
         11        SEND_VAL                                                 3
         12        DO_ICALL                                         $2      
         13        SEND_VAR                                                 $2
         14        DO_ICALL                                                 
    5    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'substr'
         17        SEND_VAL                                                 'FooBar'
         18        SEND_VAL                                                 42
         19        SEND_VAL                                                 3
         20        DO_ICALL                                         $4      
         21        SEND_VAR                                                 $4
         22        DO_ICALL                                                 
    6    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'mb_substr'
         25        SEND_VAL                                                 'FooBar'
         26        SEND_VAL                                                 42
         27        SEND_VAL                                                 3
         28        DO_ICALL                                         $6      
         29        SEND_VAR                                                 $6
         30        DO_ICALL                                                 
    7    31        INIT_FCALL                                               'var_dump'
         32        INIT_FCALL_BY_NAME                                       'iconv_substr'
         33        SEND_VAL_EX                                              'FooBar'
         34        SEND_VAL_EX                                              42
         35        SEND_VAL_EX                                              3
         36        DO_FCALL                                      0  $8      
         37        SEND_VAR                                                 $8
         38        DO_ICALL                                                 
    8    39        INIT_FCALL                                               'var_dump'
         40        INIT_FCALL_BY_NAME                                       'grapheme_substr'
         41        SEND_VAL_EX                                              'FooBar'
         42        SEND_VAL_EX                                              42
         43        SEND_VAL_EX                                              3
         44        DO_FCALL                                      0  $10     
         45        SEND_VAR                                                 $10
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.27 ms | 1400 KiB | 19 Q