3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $_test=array("Test1", "Test2"); private function &getTest() { return $this->_test; } public function tst() { $test=&$this->getTest(); $test[1]="xxx"; print_r($this->_test); } } $test=new Test(); $test->tst();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QMHLp
function name:  (null)
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'tst'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function gettest

Function tst:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QMHLp
function name:  tst
number of ops:  10
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_METHOD_CALL                                         'getTest'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN_REF                                               !0, $1
   10     3        ASSIGN_DIM                                               !0, 1
          4        OP_DATA                                                  'xxx'
   11     5        INIT_FCALL                                               'print_r'
          6        FETCH_OBJ_R                                      ~4      '_test'
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                                 
   12     9      > RETURN                                                   null

End of function tst

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.6 ms | 1395 KiB | 15 Q