3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $values = [null, null]; public $a; public $b; public function assign(&$a, &$b) { $this->a = &$a; $this->b = &$b; } public function change() { $this->a = 5; $this->b = 'foo'; } } $a = new A(); $b = &$a->values; $a->assign(...$b); $a->change(); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MAAGu
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        FETCH_OBJ_W                                      $5      !0, 'values'
          4        ASSIGN_REF                                               !1, $5
   27     5        INIT_METHOD_CALL                                         !0, 'assign'
          6        SEND_UNPACK                                              !1
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      1          
   28     9        INIT_METHOD_CALL                                         !0, 'change'
         10        DO_FCALL                                      0          
   29    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class A:
Function assign:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MAAGu
function name:  assign
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        ASSIGN_OBJ_REF                                           'a'
          3        OP_DATA                                                  !0
   14     4        ASSIGN_OBJ_REF                                           'b'
          5        OP_DATA                                                  !1
   15     6      > RETURN                                                   null

End of function assign

Function change:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MAAGu
function name:  change
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN_OBJ                                               'a'
          1        OP_DATA                                                  5
   20     2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  'foo'
   21     4      > RETURN                                                   null

End of function change

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.36 ms | 1396 KiB | 15 Q