3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $value; public function Set($value) { $this->value = $value; } public function GetByRef(&$ref) { $ref = $this->value; //SET REF PARAMETER TO THIS VALUE BY REF } } $test = new Test(); $test->Set('test'); $test->GetByRef($value1); var_dump($value1); //NULL INSTEAD OF 'test'!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KWh0i
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test, !1 = $value1
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, 'Set'
          4        SEND_VAL_EX                                              'test'
          5        DO_FCALL                                      0          
   19     6        INIT_METHOD_CALL                                         !0, 'GetByRef'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   21     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function set

Function getbyref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KWh0i
function name:  GetByRef
number of ops:  4
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~1      'value'
          2        ASSIGN                                                   !0, ~1
   14     3      > RETURN                                                   null

End of function getbyref

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 1395 KiB | 15 Q