3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __construct() { $this->foo = new B; } } class B { static $c = 0; function construct() { $this->i = ++self::$c; } } $a = new A; $b = clone $a; var_dump($a, $b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/td638
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        CLONE                                            ~5      !0
          4        ASSIGN                                                   !1, ~5
   18     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function __construct

End of class A.

Class B:
Function construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/td638
function name:  construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   PRE_INC_STATIC_PROP                              ~1      'c'
          1        ASSIGN_OBJ                                               'i'
          2        OP_DATA                                                  ~1
   13     3      > RETURN                                                   null

End of function construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.23 ms | 1395 KiB | 15 Q