3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [1,2,3,4,5]; $spliced = array_splice($arr, 2, 1); var_dump( $spliced); $number = array_shift($spliced); echo $number;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/po5kR
function name:  (null)
number of ops:  16
compiled vars:  !0 = $arr, !1 = $spliced, !2 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'array_splice'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 2
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    4     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    5    10        INIT_FCALL                                               'array_shift'
         11        SEND_REF                                                 !1
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
    6    14        ECHO                                                     !2
    7    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.16 ms | 1394 KiB | 19 Q