3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $var = ''; function setVar(&$input) { $this->var = &$input; } function getVar() { echo 'Var = ' . $this->var . '<br />'; } } $test = new Test(); $test->setVar($string); $string = 'Hello'; $test->getVar(); $string = 'Goodbye'; $test->getVar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chAlF
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        INIT_METHOD_CALL                                         !0, 'setVar'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   20     6        ASSIGN                                                   !1, 'Hello'
   22     7        INIT_METHOD_CALL                                         !0, 'getVar'
          8        DO_FCALL                                      0          
   24     9        ASSIGN                                                   !1, 'Goodbye'
   26    10        INIT_METHOD_CALL                                         !0, 'getVar'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Test:
Function setvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chAlF
function name:  setVar
number of ops:  4
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ_REF                                           'var'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setvar

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chAlF
function name:  getVar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'var'
          1        CONCAT                                           ~1      'Var+%3D+', ~0
          2        CONCAT                                           ~2      ~1, '%3Cbr+%2F%3E'
          3        ECHO                                                     ~2
   13     4      > RETURN                                                   null

End of function getvar

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.73 ms | 1394 KiB | 13 Q