3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function remove($key) { if (array_key_exists($key, $this->elements)) { $removed = $this->elements[$key]; unset($this->elements[$key]); return $removed; } $removed = $this->elements[$key]; unset($this->elements[$key]); return $removed; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuhV9
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   1

Class A:
Function remove:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuhV9
function name:  remove
number of ops:  17
compiled vars:  !0 = $key, !1 = $removed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_R                                      ~2      'elements'
          2        ARRAY_KEY_EXISTS                                         !0, ~2
          3      > JMPZ                                                     ~3, ->10
    7     4    >   FETCH_OBJ_R                                      ~4      'elements'
          5        FETCH_DIM_R                                      ~5      ~4, !0
          6        ASSIGN                                                   !1, ~5
    8     7        FETCH_OBJ_UNSET                                  $7      'elements'
          8        UNSET_DIM                                                $7, !0
   10     9      > RETURN                                                   !1
   13    10    >   FETCH_OBJ_R                                      ~8      'elements'
         11        FETCH_DIM_R                                      ~9      ~8, !0
         12        ASSIGN                                                   !1, ~9
   14    13        FETCH_OBJ_UNSET                                  $11     'elements'
         14        UNSET_DIM                                                $11, !0
   16    15      > RETURN                                                   !1
   18    16*     > RETURN                                                   null

End of function remove

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.49 ms | 1398 KiB | 13 Q