3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cars = [ [ 'Volvo', 22, 28 ], // index 0 [ 'BMW', 15, 13 ], // index 1 [ 'Land Rover', 3, 8 ], // index 2 [ 'Add Cars', 'X', 'Y' ] // index i ]; $i = count($cars) -1; // get current last set in the array unset($cars[0]); // unset Volvo unset($cars[1]); // unset BMW unset($cars[$i]); // unset index # the only index not unset is 2 (Land Rover) so it should only be left inside the array print_r($cars);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ZSaC
function name:  (null)
number of ops:  11
compiled vars:  !0 = $cars, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        COUNT                                            ~3      !0
          2        SUB                                              ~4      ~3, 1
          3        ASSIGN                                                   !1, ~4
   12     4        UNSET_DIM                                                !0, 0
   13     5        UNSET_DIM                                                !0, 1
   15     6        UNSET_DIM                                                !0, !1
   18     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.37 ms | 1070 KiB | 14 Q