3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = [0, 1]; unset($x[1]); $y = $x; $x[] = 'new'; $y[] = 'new'; last($x); last($y); var_dump(key($x)); var_dump(key($y));
based on Dv6ct
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/8PLRc
function name:  (null)
number of ops:  26
compiled vars:  !0 = $x, !1 = $y
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   4     1        UNSET_DIM                                                !0, 1
   5     2        ASSIGN                                                   !1, !0
   6     3        ASSIGN_DIM                                               !0
         4        OP_DATA                                                  'new'
   7     5        ASSIGN_DIM                                               !1
         6        OP_DATA                                                  'new'
   9     7        INIT_FCALL_BY_NAME                                       'last'
         8        SEND_VAR_EX                                              !0
         9        DO_FCALL                                      0          
        10        INIT_FCALL_BY_NAME                                       'last'
        11        SEND_VAR_EX                                              !1
        12        DO_FCALL                                      0          
  11    13        INIT_FCALL                                               'var_dump'
        14        INIT_FCALL                                               'key'
        15        SEND_VAR                                                 !0
        16        DO_ICALL                                         $8      
        17        SEND_VAR                                                 $8
        18        DO_ICALL                                                 
  12    19        INIT_FCALL                                               'var_dump'
        20        INIT_FCALL                                               'key'
        21        SEND_VAR                                                 !1
        22        DO_ICALL                                         $10     
        23        SEND_VAR                                                 $10
        24        DO_ICALL                                                 
        25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0