3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $value = 42; public function &getValue() { return $this->value; } } $obj = new foo; $myValue = &$obj->getValue(); // $myValue is a reference to $obj->value, which is 42. //$obj->value = 2; $myValue = 123; echo $obj->value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/luqSn
function name:  (null)
number of ops:  10
compiled vars:  !0 = $obj, !1 = $myValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        INIT_METHOD_CALL                                         !0, 'getValue'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN_REF                                               !1, $5
   14     6        ASSIGN                                                   !1, 123
   16     7        FETCH_OBJ_R                                      ~8      !0, 'value'
          8        ECHO                                                     ~8
          9      > RETURN                                                   1

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

End of function getvalue

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.65 ms | 1393 KiB | 13 Q