3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $obj; } class Zoo { private $obj; public function setObj($obj) { $this->obj = $obj; } public function show() { var_dump($this->obj); } } class Bar {} class Baz {} $foo = new Foo(); $zoo = new Zoo(); $a = new Bar(); $b = new Baz(); //$zoo->obj = &$foo->obj; $zoo->show(); $foo->obj = $a; $zoo->show(); $foo->obj = $b; $zoo->show();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBkXQ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $foo, !1 = $zoo, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   16     3        NEW                                              $7      'Zoo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $7
   18     6        NEW                                              $10     'Bar'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $10
   19     9        NEW                                              $13     'Baz'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $13
   22    12        INIT_METHOD_CALL                                         !1, 'show'
         13        DO_FCALL                                      0          
   23    14        ASSIGN_OBJ                                               !0, 'obj'
         15        OP_DATA                                                  !2
   24    16        INIT_METHOD_CALL                                         !1, 'show'
         17        DO_FCALL                                      0          
   25    18        ASSIGN_OBJ                                               !0, 'obj'
         19        OP_DATA                                                  !3
   26    20        INIT_METHOD_CALL                                         !1, 'show'
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

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

End of function setobj

Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBkXQ
function name:  show
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'obj'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function show

End of class Zoo.

Class Bar: [no user functions]
Class Baz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.48 ms | 1396 KiB | 15 Q