3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2,3,4,5,6); $b = array_slice($a,2,-2); $c = '123456'; $d = substr($c,2,-2); print_r($b); echo $d;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2k5al
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'array_slice'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        SEND_VAL                                                 -2
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    4     7        ASSIGN                                                   !2, '123456'
    5     8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !2
         10        SEND_VAL                                                 2
         11        SEND_VAL                                                 -2
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !3, $8
    6    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
    7    17        ECHO                                                     !3
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.76 ms | 1386 KiB | 19 Q