3v4l.org

run code in 500+ 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:  20
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'print_r'
    4     1        FRAMELESS_ICALL_2                substr              ~0      'Hello+World', 1
          2        INIT_ARRAY                                           ~1      ~0, 'substr+without+length'
    5     3        FRAMELESS_ICALL_3                substr              ~2      'Hello+World', 1
          4        OP_DATA                                                      null
          5        ADD_ARRAY_ELEMENT                                    ~1      ~2, 'substr+with+null+length'
    6     6        INIT_FCALL                                                   'mb_substr'
          7        SEND_VAL                                                     'Hello+World'
          8        SEND_VAL                                                     1
          9        DO_ICALL                                             $3      
         10        ADD_ARRAY_ELEMENT                                    ~1      $3, 'mb_substr+without+length'
    7    11        INIT_FCALL                                                   'mb_substr'
         12        SEND_VAL                                                     'Hello+World'
         13        SEND_VAL                                                     1
         14        SEND_VAL                                                     null
         15        DO_ICALL                                             $4      
         16        ADD_ARRAY_ELEMENT                                    ~1      $4, 'mb_substr+with+null+length'
         17        SEND_VAL                                                     ~1
    3    18        DO_ICALL                                                     
    8    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.13 ms | 3263 KiB | 15 Q