3v4l.org

run code in 300+ PHP versions simultaneously
<?php $posts = array("pt", "r", "bp"); $postsnew = array_slice($posts, 0, 3); $output = array_slice($input, -2, 1); // returns "d" $output = array_slice($input, 0, 3); // returns "a", "b", and "c" print_r(array_slice($posts, 0, 3)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZXW7K
function name:  (null)
number of ops:  28
compiled vars:  !0 = $posts, !1 = $postsnew, !2 = $output, !3 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_slice'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    5     7        INIT_FCALL                                               'array_slice'
          8        SEND_VAR                                                 !3
          9        SEND_VAL                                                 -2
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
    6    13        INIT_FCALL                                               'array_slice'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 3
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !2, $9
    9    19        INIT_FCALL                                               'print_r'
         20        INIT_FCALL                                               'array_slice'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 3
         24        DO_ICALL                                         $11     
         25        SEND_VAR                                                 $11
         26        DO_ICALL                                                 
   10    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.88 ms | 1400 KiB | 17 Q