3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $b; public function __construct(B $b) { $this->b = $b; var_dump($b->OMG); } } class B { const OMG = 10; public function __get($name) { return constant(self::$name); } } $b = new B(); $a = new A($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cctfh
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   22     3        NEW                                              $5      'A'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
          7      > RETURN                                                   1

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

End of function __construct

End of class A.

Class B:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cctfh
function name:  __get
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'constant'
          2        FETCH_STATIC_PROP_R          global lock         ~1      'name'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   18     6*     > RETURN                                                   null

End of function __get

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.33 ms | 1396 KiB | 17 Q