3v4l.org

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

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RN2RN
function name:  test
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_W                                      $2      'testValue'
          1        FETCH_DIM_W                                      $3      $2, 0
          2        MAKE_REF                                         $4      $3
          3        FETCH_OBJ_W                                      $0      'params'
          4        FETCH_DIM_W                                      $1      $0
          5        ASSIGN_REF                                               $1, $4
   11     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~6      'params'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
   12    10      > RETURN                                                   null

End of function test

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RN2RN
function name:  test2
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'params'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   16     4      > RETURN                                                   null

End of function test2

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.99 ms | 1388 KiB | 15 Q