3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B { private $foo = 'foo'; private $bar; public function __construct (A $x) { $this->bar = $x; } } $b1 = new B(new A); $b2 = clone $b1; var_dump($b1); var_dump($b2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Jv14
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b1, !1 = $b2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'B'
          1        NEW                                              $3      'A'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   12     6        CLONE                                            ~7      !0
          7        ASSIGN                                                   !1, ~7
   13     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   14    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Jv14
function name:  __construct
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.38 ms | 1395 KiB | 15 Q