3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function & bar() { return $this->var = $this->baz(); } 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/06MGO
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   21     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   23     9        INIT_METHOD_CALL                                         !0, 'bar'
         10        DO_FCALL                                      0  $8      
         11        ASSIGN_REF                                               !1, $8
   25    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   27    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !0, 'baz'
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/06MGO
function name:  bar
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'baz'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN_OBJ                                       ~0      'var'
          3        OP_DATA                                                  $1
          4      > RETURN_BY_REF                                            ~0
    8     5*     > 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/06MGO
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'hello'
   13     1*     > RETURN                                                   null

End of function baz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.22 ms | 1391 KiB | 16 Q