3v4l.org

run code in 200+ PHP versions simultaneously
<?php $lost = array("A","B","C","D"); // $list = $lost; # cow-count2 // $list = &$lost; # refcount2 $list = $lost; unset($lost); # just like just assigned but assigned and unset original. foreach ( $list as $var ) { printf("%s (%s)\n", item($list), $var); } function item(&$list) { return current($list); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/CglJL
function name:  (null)
number of ops:  16
compiled vars:  !0 = $lost, !1 = $list, !2 = $var
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   QM_ASSIGN                                                !0
   6     1        QM_ASSIGN                                                !1
         2        DECLARE_LAMBDA_FUNCTION                                  !0
   9     3      > FE_RESET_R                                       $5      !1, ->14
         4    > > FE_FETCH_R                                               $5, !2, ->14
  10     5    >   INIT_FCALL                                               'printf'
         6        SEND_VAL                                                 '%25s+%28%25s%29%0A'
         7        INIT_FCALL_BY_NAME                                       'item'
         8        SEND_VAR_EX                                              !1
         9        DO_FCALL                                      0  $6      
        10        SEND_VAR                                                 $6
        11        SEND_VAR                                                 !2
        12        DO_ICALL                                                 
   9    13      > JMP                                                      ->4
        14    >   FE_FREE                                                  $5
  17    15      > RETURN                                                   1

Function item:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CglJL
function name:  item
number of ops:  6
compiled vars:  !0 = $list
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  13     0  E >   RECV                                             !0      
  14     1        INIT_FCALL                                               'current'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                         $1      
         4      > RETURN                                                   $1
  15     5*     > RETURN                                                   null

End of function item

Generated using Vulcan Logic Dumper, using php 7.4.0