3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ByRef { protected $age; public function assignJustArgByRef(&$age) { $this->age = $age; } public function getAge() { return (string) $this->age; } } $age = 0; $ByRef = new ByRef(); $ByRef->assignJustArgByRef($age); $age++; echo $ByRef->getAge();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VAe9Q
function name:  (null)
number of ops:  12
compiled vars:  !0 = $age, !1 = $ByRef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 0
   18     1        NEW                                              $3      'ByRef'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   20     4        INIT_METHOD_CALL                                         !1, 'assignJustArgByRef'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   21     7        PRE_INC                                                  !0
   23     8        INIT_METHOD_CALL                                         !1, 'getAge'
          9        DO_FCALL                                      0  $8      
         10        ECHO                                                     $8
         11      > RETURN                                                   1

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

End of function assignjustargbyref

Function getage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VAe9Q
function name:  getAge
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'age'
          1        CAST                                          6  ~1      ~0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function getage

End of class ByRef.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.25 ms | 1394 KiB | 13 Q