3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $name; private $value; public function __construct($name, $value) { $this->name = $name; $this->value = $value; } public function __get($prop) { return $this->$prop; } public function __isset($prop) { return isset($this->$prop); } } $ar = [ new Foo('foo', 'a'), new Foo('bar', 'b'), new Foo('baz', 'c') ]; print_r(array_column($ar, 'value', 'name'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RYTC8
function name:  (null)
number of ops:  25
compiled vars:  !0 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'Foo'
          1        SEND_VAL_EX                                              'foo'
          2        SEND_VAL_EX                                              'a'
          3        DO_FCALL                                      0          
          4        INIT_ARRAY                                       ~3      $1
   27     5        NEW                                              $4      'Foo'
          6        SEND_VAL_EX                                              'bar'
          7        SEND_VAL_EX                                              'b'
          8        DO_FCALL                                      0          
          9        ADD_ARRAY_ELEMENT                                ~3      $4
   28    10        NEW                                              $6      'Foo'
         11        SEND_VAL_EX                                              'baz'
         12        SEND_VAL_EX                                              'c'
         13        DO_FCALL                                      0          
         14        ADD_ARRAY_ELEMENT                                ~3      $6
   25    15        ASSIGN                                                   !0, ~3
   31    16        INIT_FCALL                                               'print_r'
         17        INIT_FCALL                                               'array_column'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'value'
         20        SEND_VAL                                                 'name'
         21        DO_ICALL                                         $9      
         22        SEND_VAR                                                 $9
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RYTC8
function name:  __construct
number of ops:  7
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ASSIGN_OBJ                                               'name'
          3        OP_DATA                                                  !0
   11     4        ASSIGN_OBJ                                               'value'
          5        OP_DATA                                                  !1
   12     6      > RETURN                                                   null

End of function __construct

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

End of function __get

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RYTC8
function name:  __isset
number of ops:  4
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2      > RETURN                                                   ~1
   22     3*     > RETURN                                                   null

End of function __isset

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.14 ms | 1400 KiB | 17 Q