3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container implements ArrayAccess { private $classes = array(); public function offsetSet($offset, $value) { $this->classes[$offset] = $value; } public function offsetExists($offset) { return isset($this->classes[$offset]); } public function offsetUnset($offset) { unset($this->classes[$offset]); } public function offsetGet($offset) { return isset($this->classes[$offset]) ? $this->classes[$offset] : null; } } // usage $container = new Container; $container['core'] = new stdClass;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpY92
function name:  (null)
number of ops:  9
compiled vars:  !0 = $container
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'container'
   27     1        NEW                                              $1      'Container'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   29     4        NEW                                              $5      'stdClass'
          5        DO_FCALL                                      0          
          6        ASSIGN_DIM                                               !0, 'core'
          7        OP_DATA                                                  $5
          8      > RETURN                                                   1

Class Container:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpY92
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        FETCH_OBJ_W                                      $2      'classes'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
    9     5      > RETURN                                                   null

End of function offsetset

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpY92
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_IS                                     ~1      'classes'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3      > RETURN                                                   ~2
   13     4*     > RETURN                                                   null

End of function offsetexists

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpY92
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        FETCH_OBJ_UNSET                                  $1      'classes'
          2        UNSET_DIM                                                $1, !0
   17     3      > RETURN                                                   null

End of function offsetunset

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpY92
function name:  offsetGet
number of ops:  11
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_IS                                     ~1      'classes'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          3      > JMPZ                                                     ~2, ->8
          4    >   FETCH_OBJ_R                                      ~3      'classes'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6        QM_ASSIGN                                        ~5      ~4
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~5      null
          9    > > RETURN                                                   ~5
   21    10*     > RETURN                                                   null

End of function offsetget

End of class Container.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.22 ms | 1399 KiB | 13 Q