3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['a', 'b', 'c']; print_r(array_slice($array, 0, 1)); // a print_r(array_slice($array, 1, 1)); // b print_r(array_slice($array, 2, 1)); // c print_r(array_slice($array, 3, 1)); // none print_r(array_slice($array, -1, 1)); // c print_r(array_slice($array, -2, 1)); // b print_r(array_slice($array, -3, 1)); // a print_r(array_slice($array, -4, 1)); // a !?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kBXGe
function name:  (null)
number of ops:  66
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'array_slice'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
    4     9        INIT_FCALL                                               'print_r'
         10        INIT_FCALL                                               'array_slice'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 1
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                                 
    5    17        INIT_FCALL                                               'print_r'
         18        INIT_FCALL                                               'array_slice'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 2
         21        SEND_VAL                                                 1
         22        DO_ICALL                                         $6      
         23        SEND_VAR                                                 $6
         24        DO_ICALL                                                 
    6    25        INIT_FCALL                                               'print_r'
         26        INIT_FCALL                                               'array_slice'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 3
         29        SEND_VAL                                                 1
         30        DO_ICALL                                         $8      
         31        SEND_VAR                                                 $8
         32        DO_ICALL                                                 
    8    33        INIT_FCALL                                               'print_r'
         34        INIT_FCALL                                               'array_slice'
         35        SEND_VAR                                                 !0
         36        SEND_VAL                                                 -1
         37        SEND_VAL                                                 1
         38        DO_ICALL                                         $10     
         39        SEND_VAR                                                 $10
         40        DO_ICALL                                                 
    9    41        INIT_FCALL                                               'print_r'
         42        INIT_FCALL                                               'array_slice'
         43        SEND_VAR                                                 !0
         44        SEND_VAL                                                 -2
         45        SEND_VAL                                                 1
         46        DO_ICALL                                         $12     
         47        SEND_VAR                                                 $12
         48        DO_ICALL                                                 
   10    49        INIT_FCALL                                               'print_r'
         50        INIT_FCALL                                               'array_slice'
         51        SEND_VAR                                                 !0
         52        SEND_VAL                                                 -3
         53        SEND_VAL                                                 1
         54        DO_ICALL                                         $14     
         55        SEND_VAR                                                 $14
         56        DO_ICALL                                                 
   11    57        INIT_FCALL                                               'print_r'
         58        INIT_FCALL                                               'array_slice'
         59        SEND_VAR                                                 !0
         60        SEND_VAL                                                 -4
         61        SEND_VAL                                                 1
         62        DO_ICALL                                         $16     
         63        SEND_VAR                                                 $16
         64        DO_ICALL                                                 
         65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.13 ms | 1405 KiB | 17 Q