3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = range(0,10); $slice = array_slice($array,12); // same with and without the offset parameter! print_r($slice); // Empty! $array = range(0,5); $slice = array_slice($array,3); print_r($slice); // As expected 3 elements!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tPsel
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array, !1 = $slice
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'range'
          1        SEND_VAL                                                     0
          2        SEND_VAL                                                     10
          3        DO_ICALL                                             $2      
          4        ASSIGN                                                       !0, $2
    4     5        INIT_FCALL                                                   'array_slice'
          6        SEND_VAR                                                     !0
          7        SEND_VAL                                                     12
          8        DO_ICALL                                             $4      
          9        ASSIGN                                                       !1, $4
    5    10        INIT_FCALL                                                   'print_r'
         11        SEND_VAR                                                     !1
         12        DO_ICALL                                                     
    7    13        INIT_FCALL                                                   'range'
         14        SEND_VAL                                                     0
         15        SEND_VAL                                                     5
         16        DO_ICALL                                             $7      
         17        ASSIGN                                                       !0, $7
    8    18        INIT_FCALL                                                   'array_slice'
         19        SEND_VAR                                                     !0
         20        SEND_VAL                                                     3
         21        DO_ICALL                                             $9      
         22        ASSIGN                                                       !1, $9
    9    23        INIT_FCALL                                                   'print_r'
         24        SEND_VAR                                                     !1
         25        DO_ICALL                                                     
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
223.67 ms | 2530 KiB | 11 Q