3v4l.org

run code in 300+ PHP versions simultaneously
<?php $z = 'b'; $a = [ 'a', $z, 'c' ]; foreach(z($a) as &$x) { $x .= 'q'; } print_r($a); function z($a) { return $a; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 126) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/YYvHn
function name:  (null)
number of ops:  18
compiled vars:  !0 = $z, !1 = $a, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'b'
    4     1        INIT_ARRAY                                       ~4      'a'
          2        ADD_ARRAY_ELEMENT                                ~4      !0
          3        ADD_ARRAY_ELEMENT                                ~4      'c'
          4        ASSIGN                                                   !1, ~4
    5     5        INIT_FCALL_BY_NAME                                       'z'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $6      
          8        SEPARATE                                         $6      $6
          9      > FE_RESET_RW                                      $7      $6, ->13
         10    > > FE_FETCH_RW                                              $7, !2, ->13
    6    11    >   ASSIGN_OP                                     8          !2, 'q'
    5    12      > JMP                                                      ->10
         13    >   FE_FREE                                                  $7
    8    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   13    17      > RETURN                                                   1

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

End of function z

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.23 ms | 1387 KiB | 15 Q