3v4l.org

run code in 300+ PHP versions simultaneously
<?php class aa implements ArrayAccess { protected $_data = array(); public function offsetGet($key) { return $this->_data[$key]; } public function offsetSet($key, $value) { $this->_data[$key] = $value; } public function offsetExists($key) { return isset($this->_data[$key]); } public function offsetUnset($key) { unset($this->_data[$key]); } } $a = new aa; $a['name'] = 'Dżozef'; $a['id'] = 5; $b = array(); $b[0] = $a; $b[1] = array( 'name' => 'Kinszasa', 'id' => 17, ); var_dump(array_column($b, null, 'id'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/13sdC
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'aa'
   24     1        NEW                                              $2      'aa'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   25     4        ASSIGN_DIM                                               !0, 'name'
          5        OP_DATA                                                  'D%C5%BCozef'
   26     6        ASSIGN_DIM                                               !0, 'id'
          7        OP_DATA                                                  5
   28     8        ASSIGN                                                   !1, <array>
   29     9        ASSIGN_DIM                                               !1, 0
         10        OP_DATA                                                  !0
   30    11        ASSIGN_DIM                                               !1, 1
   31    12        OP_DATA                                                  <array>
   34    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'array_column'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 null
         17        SEND_VAL                                                 'id'
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class aa:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/13sdC
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        FETCH_OBJ_R                                      ~1      '_data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   10     4*     > 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/13sdC
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_OBJ_W                                      $2      '_data'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   14     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/13sdC
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        FETCH_OBJ_IS                                     ~1      '_data'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3      > RETURN                                                   ~2
   18     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/13sdC
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        FETCH_OBJ_UNSET                                  $1      '_data'
          2        UNSET_DIM                                                $1, !0
   22     3      > RETURN                                                   null

End of function offsetunset

End of class aa.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.46 ms | 1400 KiB | 17 Q