3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements ArrayAccess { public $Id, $Title; public function offsetExists($offset) { return isset($this->{$offset}); } public function offsetGet($offset) { return $this->{$offset}; } public function offsetSet($offset, $value) { $this->{$offset} = $value; } public function offsetUnset($offset) { unset($this->{$offset}); } } $object = new Foo(); $object->Id = 1; $object->Title = 'Test'; $records = array( $object, array( 'Id' => 2, 'Title' => 'John' ) ); print_r(array_column($records, 'Title'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IWoS7
function name:  (null)
number of ops:  19
compiled vars:  !0 = $object, !1 = $records
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   28     1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   29     4        ASSIGN_OBJ                                               !0, 'Id'
          5        OP_DATA                                                  1
   30     6        ASSIGN_OBJ                                               !0, 'Title'
          7        OP_DATA                                                  'Test'
   33     8        INIT_ARRAY                                       ~7      !0
          9        ADD_ARRAY_ELEMENT                                ~7      <array>
   32    10        ASSIGN                                                   !1, ~7
   40    11        INIT_FCALL                                               'print_r'
         12        INIT_FCALL                                               'array_column'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 'Title'
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class Foo:
Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IWoS7
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IWoS7
function name:  offsetGet
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   15     3*     > RETURN                                                   null

End of function offsetget

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IWoS7
function name:  offsetSet
number of ops:  5
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   20     4      > RETURN                                                   null

End of function offsetset

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IWoS7
function name:  offsetUnset
number of ops:  3
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        UNSET_OBJ                                                !0
   25     2      > RETURN                                                   null

End of function offsetunset

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.03 ms | 945 KiB | 18 Q