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; } $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/FXIX3
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     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/FXIX3
function name:  __construct
number of ops:  9
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_CLASS                                   0  $2      !0
          5        FETCH_CLASS_CONSTANT                             ~3      $2, 'OMG'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   10     8      > RETURN                                                   null

End of function __construct

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.69 ms | 1386 KiB | 15 Q