3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $value = 3; function &getValue() { return $this->value; } function test() { $params = array(); $params[] = &$this->getValue(); $params[] = $this->getValue(); return $params; } } $foo = new Foo(); var_dump($foo->test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3nUAA
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function getvalue

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3nUAA
function name:  test
number of ops:  12
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_METHOD_CALL                                         'getValue'
          2        DO_FCALL                                      0  $3      
          3        MAKE_REF                                         $4      $3
          4        FETCH_DIM_W                                      $2      !0
          5        ASSIGN_REF                                               $2, $4
   15     6        INIT_METHOD_CALL                                         'getValue'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  $7
   16    10      > RETURN                                                   !0
   17    11*     > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.04 ms | 1396 KiB | 15 Q