3v4l.org

run code in 300+ PHP versions simultaneously
<?php class b{ public $o; public function __construct(){ $this->o = (object)array('id'=>12); } } class foo { private $b; public function __construct(){ $this->b = new b(); } public function bar(){ return $this->b; } } $f = new foo(); var_dump( $f->bar()->o->id );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nBb8P
function name:  (null)
number of ops:  11
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'bar'
          5        DO_FCALL                                      0  $4      
          6        FETCH_OBJ_R                                      ~5      $4, 'o'
          7        FETCH_OBJ_R                                      ~6      ~5, 'id'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class b:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nBb8P
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   CAST                                          8  ~1      <array>
          1        ASSIGN_OBJ                                               'o'
          2        OP_DATA                                                  ~1
    7     3      > RETURN                                                   null

End of function __construct

End of class b.

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nBb8P
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  $1
   15     4      > RETURN                                                   null

End of function __construct

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nBb8P
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'b'
          1      > RETURN                                                   ~0
   19     2*     > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.17 ms | 1396 KiB | 15 Q