3v4l.org

run code in 300+ PHP versions simultaneously
<?php $GLOBALS['bar'] = 5; function &getSpecialValue() { return $GLOBALS['bar']; } class Foo { public $value = 3; function &getValue() { return $this->value; } function test() { $params = array(); $params[] = &$this->getValue(); $params[] = $this->getValue(); $params[] = &getSpecialValue(); 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/c3JJI
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $1      'GLOBALS'
          1        ASSIGN_DIM                                               $1, 'bar'
          2        OP_DATA                                                  5
   27     3        NEW                                              $3      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   29     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'test'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function getspecialvalue:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/c3JJI
function name:  getSpecialValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_W                      global              $0      'GLOBALS'
          1        FETCH_DIM_W                                      $1      $0, 'bar'
          2      > RETURN_BY_REF                                            $1
    7     3*     > RETURN_BY_REF                                            null

End of function getspecialvalue

Class Foo:
Function getvalue:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/c3JJI
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_W                                      $0      'value'
          1      > RETURN_BY_REF                                            $0
   15     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/c3JJI
function name:  test
number of ops:  17
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   19     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
   20     6        INIT_METHOD_CALL                                         'getValue'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  $7
   21    10        INIT_FCALL                                               'getspecialvalue'
         11        DO_FCALL                                      0  $9      
         12        MAKE_REF                                         $10     $9
         13        FETCH_DIM_W                                      $8      !0
         14        ASSIGN_REF                                               $8, $10
   22    15      > RETURN                                                   !0
   23    16*     > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.62 ms | 1403 KiB | 16 Q