3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $obj; } class Zoo { public $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/NlDsB
function name:  (null)
number of ops:  27
compiled vars:  !0 = $foo, !1 = $zoo, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   15     3        NEW                                              $7      'Zoo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $7
   17     6        NEW                                              $10     'Bar'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $10
   18     9        NEW                                              $13     'Baz'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $13
   20    12        FETCH_OBJ_W                                      $17     !0, 'obj'
         13        MAKE_REF                                         $18     $17
         14        ASSIGN_OBJ_REF                                           !1, 'obj'
         15        OP_DATA                                                  $18
   21    16        INIT_METHOD_CALL                                         !1, 'show'
         17        DO_FCALL                                      0          
   22    18        ASSIGN_OBJ                                               !0, 'obj'
         19        OP_DATA                                                  !2
   23    20        INIT_METHOD_CALL                                         !1, 'show'
         21        DO_FCALL                                      0          
   24    22        ASSIGN_OBJ                                               !0, 'obj'
         23        OP_DATA                                                  !3
   25    24        INIT_METHOD_CALL                                         !1, 'show'
         25        DO_FCALL                                      0          
         26      > RETURN                                                   1

Class Foo: [no user functions]
Class Zoo:
Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NlDsB
function name:  show
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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:
204.74 ms | 1400 KiB | 15 Q