3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = []; $key = 'foo'; $val = $arr[$key] ?? null; unset($arr[$key]); echo $val;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J4fpO
function name:  (null)
number of ops:  9
compiled vars:  !0 = $arr, !1 = $key, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'foo'
    6     2        FETCH_DIM_IS                                     ~5      !0, !1
          3        COALESCE                                         ~6      ~5
          4        QM_ASSIGN                                        ~6      null
          5        ASSIGN                                                   !2, ~6
          6        UNSET_DIM                                                !0, !1
    8     7        ECHO                                                     !2
          8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.84 ms | 1392 KiB | 13 Q