3v4l.org

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

Class Test:
Function gettest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TLkNl
function name:  getTest
number of ops:  4
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_W                                      $1      '_test'
          1        ASSIGN_REF                                               !0, $1
    6     2      > RETURN                                                   !0
    7     3*     > RETURN                                                   null

End of function gettest

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

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.7 ms | 1395 KiB | 15 Q