3v4l.org

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

Class Foo:
Function bar1:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/pKpZL
function name:  bar1
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       $0      
          1      > RETURN_BY_REF                                            $0
          2*     > RETURN_BY_REF                                            null

End of function bar1

Function bar2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pKpZL
function name:  bar2
number of ops:  6
compiled vars:  !0 = $o, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_METHOD_CALL                                         'bar1'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN_REF                                               !1, $2
          4        ASSIGN                                                   !1, !0
          5      > RETURN                                                   null

End of function bar2

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.19 ms | 1396 KiB | 15 Q