3v4l.org

run code in 300+ PHP versions simultaneously
L<?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/ddJnf
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'L'
    5     1        DECLARE_CLASS                                            'foo'
   11     2        NEW                                              $2      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   12     5        INIT_METHOD_CALL                                         !0, 'get'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN_REF                                               !1, $5
   13     8        ASSIGN                                                   !1, 7
   14     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'get'
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function get

End of class FooInterface.

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

End of function get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.56 ms | 1387 KiB | 15 Q