3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $a = 'A'; public function setA($a) { $this->a = $a; } public function getA() { return $this->a; } } class B { protected $a; public function setA(A $a = null) { $this->a = $a; } public function getA() { return $this->a; } } $b = new B(); $b->setA(new A()); var_dump($b); $c = clone($b); var_dump($c); $b->setA(null); var_dump($b); var_dump($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IbL9W
function name:  (null)
number of ops:  26
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   34     3        INIT_METHOD_CALL                                         !0, 'setA'
          4        NEW                                              $5      'A'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $5
          7        DO_FCALL                                      0          
   35     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   37    11        CLONE                                            ~9      !0
         12        ASSIGN                                                   !1, ~9
   38    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
   40    16        INIT_METHOD_CALL                                         !0, 'setA'
         17        SEND_VAL_EX                                              null
         18        DO_FCALL                                      0          
   41    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   42    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class A:
Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IbL9W
function name:  setA
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function seta

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

End of function geta

End of class A.

Class B:
Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IbL9W
function name:  setA
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV_INIT                                        !0      null
   24     1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  !0
   25     3      > RETURN                                                   null

End of function seta

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

End of function geta

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.36 ms | 1392 KiB | 15 Q