3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeObject { private $name; public function __construct($name) { $this->name = $name; } } class SomeClass1 { private $object; public function __construct($object) { $this->object = $object; } public function getObject() { return $this->object; } } class SomeClass2 { private $object; public function __construct(&$object) { $this->object = $object; } public function getObject() { return $this->object; } } $object1 = new SomeObject('obj1'); $object2 = new SomeObject('obj2'); $someClass1 = new SomeClass1($object1); $someClass2 = new SomeClass2($object2); $object1 = null; $object2 = null; var_dump($someClass1->getObject()); var_dump($someClass2->getObject()); var_dump($object1); var_dump($object2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b4ij1
function name:  (null)
number of ops:  35
compiled vars:  !0 = $object1, !1 = $object2, !2 = $someClass1, !3 = $someClass2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   NEW                                              $4      'SomeObject'
          1        SEND_VAL_EX                                              'obj1'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   44     4        NEW                                              $7      'SomeObject'
          5        SEND_VAL_EX                                              'obj2'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   45     8        NEW                                              $10     'SomeClass1'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $10
   46    12        NEW                                              $13     'SomeClass2'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $13
   47    16        ASSIGN                                                   !0, null
   48    17        ASSIGN                                                   !1, null
   49    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !2, 'getObject'
         20        DO_FCALL                                      0  $18     
         21        SEND_VAR                                                 $18
         22        DO_ICALL                                                 
   50    23        INIT_FCALL                                               'var_dump'
         24        INIT_METHOD_CALL                                         !3, 'getObject'
         25        DO_FCALL                                      0  $20     
         26        SEND_VAR                                                 $20
         27        DO_ICALL                                                 
   51    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
   52    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

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

End of function __construct

End of class SomeObject.

Class SomeClass1:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b4ij1
function name:  __construct
number of ops:  4
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ASSIGN_OBJ                                               'object'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function __construct

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

End of function getobject

End of class SomeClass1.

Class SomeClass2:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b4ij1
function name:  __construct
number of ops:  4
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        ASSIGN_OBJ                                               'object'
          2        OP_DATA                                                  !0
   35     3      > RETURN                                                   null

End of function __construct

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

End of function getobject

End of class SomeClass2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.56 ms | 1015 KiB | 14 Q