3v4l.org

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

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/Rf9I0
function name:  bar
number of ops:  8
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_METHOD_CALL                                         'baz'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                           ~3      !0, $2
          3        ASSIGN_OBJ                                               'var'
          4        OP_DATA                                                  ~3
   10     5        FETCH_OBJ_W                                      $4      'var'
          6      > RETURN_BY_REF                                            $4
   11     7*     > RETURN_BY_REF                                            null

End of function bar

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

End of function baz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.16 ms | 1401 KiB | 15 Q