3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FooInterface { public function get(); } class Foo implements FooInterface { protected $thing = 5; public function &get() { return $this->thing; } } $foo = new Foo(); $thing = &$foo->get(); $thing = 7; var_dump($foo->get());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XquJL
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo, !1 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'foo'
   11     1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   12     4        INIT_METHOD_CALL                                         !0, 'get'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN_REF                                               !1, $5
   13     7        ASSIGN                                                   !1, 7
   14     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'get'
         10        DO_FCALL                                      0  $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class FooInterface:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XquJL
function name:  get
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   null

End of function get

End of class FooInterface.

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

End of function get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.6 ms | 1395 KiB | 15 Q