3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ByRef { protected $argAge; protected $bothAge; public function assignJustArgByRef(&$age) { $this->argAge = $age; } public function assignArgAndExpressionByRef(&$age) { $this->bothAge =& $age; } public function getArgAge() { return $this->argAge; } public function getBothAge() { return $this->bothAge; } } $age = 0; $ByRef = new ByRef(); $ByRef->assignJustArgByRef($age); $age++; echo $ByRef->getArgAge(); $newAge = 0; $ByRef->assignArgAndExpressionByRef($newAge); $newAge++; echo $ByRef->getBothAge();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeUn
function name:  (null)
number of ops:  20
compiled vars:  !0 = $age, !1 = $ByRef, !2 = $newAge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ASSIGN                                                   !0, 0
   27     1        NEW                                              $4      'ByRef'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   29     4        INIT_METHOD_CALL                                         !1, 'assignJustArgByRef'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   30     7        PRE_INC                                                  !0
   31     8        INIT_METHOD_CALL                                         !1, 'getArgAge'
          9        DO_FCALL                                      0  $9      
         10        ECHO                                                     $9
   34    11        ASSIGN                                                   !2, 0
   35    12        INIT_METHOD_CALL                                         !1, 'assignArgAndExpressionByRef'
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0          
   36    15        PRE_INC                                                  !2
   37    16        INIT_METHOD_CALL                                         !1, 'getBothAge'
         17        DO_FCALL                                      0  $13     
         18        ECHO                                                     $13
         19      > RETURN                                                   1

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

End of function assignjustargbyref

Function assignargandexpressionbyref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeUn
function name:  assignArgAndExpressionByRef
number of ops:  4
compiled vars:  !0 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ_REF                                           'bothAge'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function assignargandexpressionbyref

Function getargage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeUn
function name:  getArgAge
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'argAge'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getargage

Function getbothage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeUn
function name:  getBothAge
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'bothAge'
          1      > RETURN                                                   ~0
   22     2*     > RETURN                                                   null

End of function getbothage

End of class ByRef.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.66 ms | 1399 KiB | 13 Q