3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func(&$arraykey) { return $arraykey; // function returns by value! } $array = array('a', 'b', 'c'); foreach (array_keys($array) as $key) { $y = &func($array[$key]); $z[] =& $y; } var_dump($z);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/XnVHZ
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $key, !2 = $y, !3 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4      > FE_RESET_R                                       $6      $5, ->14
          5    > > FE_FETCH_R                                               $6, !1, ->14
    8     6    >   INIT_FCALL                                               'func'
          7        FETCH_DIM_W                                      $7      !0, !1
          8        SEND_REF                                                 $7
          9        DO_FCALL                                      0  $8      
         10        ASSIGN_REF                                               !2, $8
    9    11        FETCH_DIM_W                                      $10     !3
         12        ASSIGN_REF                                               $10, !2
    7    13      > JMP                                                      ->5
         14    >   FE_FREE                                                  $6
   12    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XnVHZ
function name:  func
number of ops:  3
compiled vars:  !0 = $arraykey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1      > RETURN                                                   !0
    4     2*     > RETURN                                                   null

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.54 ms | 1398 KiB | 18 Q