3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $obj; } class Zoo { public $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; $foo->obj = new stdClass(); $zoo->setObj($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/oCtgT
function name:  (null)
number of ops:  32
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        NEW                                              $17     'stdClass'
         13        DO_FCALL                                      0          
         14        ASSIGN_OBJ                                               !0, 'obj'
         15        OP_DATA                                                  $17
   23    16        INIT_METHOD_CALL                                         !1, 'setObj'
         17        CHECK_FUNC_ARG                                           
         18        FETCH_OBJ_FUNC_ARG                               $19     !0, 'obj'
         19        SEND_FUNC_ARG                                            $19
         20        DO_FCALL                                      0          
   24    21        INIT_METHOD_CALL                                         !1, 'show'
         22        DO_FCALL                                      0          
   25    23        ASSIGN_OBJ                                               !0, 'obj'
         24        OP_DATA                                                  !2
   26    25        INIT_METHOD_CALL                                         !1, 'show'
         26        DO_FCALL                                      0          
   27    27        ASSIGN_OBJ                                               !0, 'obj'
         28        OP_DATA                                                  !3
   28    29        INIT_METHOD_CALL                                         !1, 'show'
         30        DO_FCALL                                      0          
         31      > 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/oCtgT
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/oCtgT
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:
160.96 ms | 1392 KiB | 15 Q