3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $foo = 5; public function &test() { return $this->foo; } } function &getFoo() { $var = 6; return $var; } $test = new Test(); $var[] = $test->test(); $var[] = getFoo(); var_dump($var);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UGXWs
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   22     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  $6
   23     7        INIT_FCALL                                               'getfoo'
          8        DO_FCALL                                      0  $8      
          9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  $8
   25    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function getfoo:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/UGXWs
function name:  getFoo
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 6
   18     1      > RETURN_BY_REF                                            !0
   19     2*     > RETURN_BY_REF                                            null

End of function getfoo

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

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.17 ms | 1398 KiB | 16 Q