3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(10,8,7,1,2,3,4,5,6); sort($arr); var_dump($arr);exit; foreach ($arr as $k => $v) { if ($k == 2) { unset($arr[$k]); } } reset($arr); var_dump($arr[2]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/YWf6D
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'sort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > EXIT                                                     
    6     8*       FE_RESET_R                                       $6      !0, ->15
          9*       FE_FETCH_R                                       ~7      $6, !1, ->15
         10*       ASSIGN                                                   !2, ~7
    8    11*       IS_EQUAL                                                 !2, 2
         12*       JMPZ                                                     ~9, ->14
    9    13*       UNSET_DIM                                                !0, !2
    6    14*       JMP                                                      ->9
         15*       FE_FREE                                                  $6
   12    16*       INIT_FCALL                                               'reset'
         17*       SEND_REF                                                 !0
         18*       DO_ICALL                                                 
   13    19*       INIT_FCALL                                               'var_dump'
         20*       FETCH_DIM_R                                      ~11     !0, 2
         21*       SEND_VAL                                                 ~11
         22*       DO_ICALL                                                 
         23*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.87 ms | 1395 KiB | 19 Q