3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fields = []; $rowData = []; $fields[] = &$rowData['column1']; $fields[] = &$rowData['column2']; useRefs(...$fields); var_dump($rowData); useRefs2(...$fields); var_dump($rowData); function useRefs(&...$fields) { $fields[0] = 'col 1 value 1'; $fields[1] = 'col 2 value 1'; } function useRefs2(&...$fields) { $fields[0] = 'col 1 value 2'; $fields[1] = null; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FqFmT
function name:  (null)
number of ops:  25
compiled vars:  !0 = $fields, !1 = $rowData
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        FETCH_DIM_W                                      $5      !1, 'column1'
          3        MAKE_REF                                         $6      $5
          4        FETCH_DIM_W                                      $4      !0
          5        ASSIGN_REF                                               $4, $6
    7     6        FETCH_DIM_W                                      $9      !1, 'column2'
          7        MAKE_REF                                         $10     $9
          8        FETCH_DIM_W                                      $8      !0
          9        ASSIGN_REF                                               $8, $10
    9    10        INIT_FCALL_BY_NAME                                       'useRefs'
         11        SEND_UNPACK                                              !0
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      1          
   10    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   12    17        INIT_FCALL_BY_NAME                                       'useRefs2'
         18        SEND_UNPACK                                              !0
         19        CHECK_UNDEF_ARGS                                         
         20        DO_FCALL                                      1          
   13    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   25    24      > RETURN                                                   1

Function userefs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FqFmT
function name:  useRefs
number of ops:  6
compiled vars:  !0 = $fields
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_VARIADIC                                    !0      
   17     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  'col+1+value+1'
   18     3        ASSIGN_DIM                                               !0, 1
          4        OP_DATA                                                  'col+2+value+1'
   19     5      > RETURN                                                   null

End of function userefs

Function userefs2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FqFmT
function name:  useRefs2
number of ops:  6
compiled vars:  !0 = $fields
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV_VARIADIC                                    !0      
   23     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  'col+1+value+2'
   24     3        ASSIGN_DIM                                               !0, 1
          4        OP_DATA                                                  null
   25     5      > RETURN                                                   null

End of function userefs2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.8 ms | 1400 KiB | 15 Q