3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r([ 'substr without length' => substr('Hello World', 1), 'substr with null length' => substr('Hello World', 1, null), 'mb_substr without length' => mb_substr('Hello World', 1), 'mb_substr with null length' => mb_substr('Hello World', 1, null), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YpuO1
function name:  (null)
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'print_r'
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAL                                                 'Hello+World'
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $0      
          5        INIT_ARRAY                                       ~1      $0, 'substr+without+length'
    5     6        INIT_FCALL                                               'substr'
          7        SEND_VAL                                                 'Hello+World'
          8        SEND_VAL                                                 1
          9        SEND_VAL                                                 null
         10        DO_ICALL                                         $2      
         11        ADD_ARRAY_ELEMENT                                ~1      $2, 'substr+with+null+length'
    6    12        INIT_FCALL                                               'mb_substr'
         13        SEND_VAL                                                 'Hello+World'
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $3      
         16        ADD_ARRAY_ELEMENT                                ~1      $3, 'mb_substr+without+length'
    7    17        INIT_FCALL                                               'mb_substr'
         18        SEND_VAL                                                 'Hello+World'
         19        SEND_VAL                                                 1
         20        SEND_VAL                                                 null
         21        DO_ICALL                                         $4      
         22        ADD_ARRAY_ELEMENT                                ~1      $4, 'mb_substr+with+null+length'
         23        SEND_VAL                                                 ~1
         24        DO_ICALL                                                 
    8    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.45 ms | 1400 KiB | 19 Q