3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('1', '2', '3'); z($arr); function z($arr) { foreach ($arr as $key=>&$val) { $arr[3] = '999'; echo $val."\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7qAjp
function name:  (null)
number of ops:  5
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL_BY_NAME                                       'z'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   12     4      > RETURN                                                   1

Function z:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/7qAjp
function name:  z
number of ops:  11
compiled vars:  !0 = $arr, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1      > FE_RESET_RW                                      $3      !0, ->9
          2    > > FE_FETCH_RW                                      ~4      $3, !1, ->9
          3    >   ASSIGN                                                   !2, ~4
    9     4        ASSIGN_DIM                                               !0, 3
          5        OP_DATA                                                  '999'
   10     6        CONCAT                                           ~7      !1, '%0A'
          7        ECHO                                                     ~7
    7     8      > JMP                                                      ->2
          9    >   FE_FREE                                                  $3
   12    10      > RETURN                                                   null

End of function z

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.2 ms | 1393 KiB | 13 Q