3v4l.org

run code in 300+ 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. $list = (array) $lost; 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 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/lYskJ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $lost, !1 = $list, !2 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, !0
    7     2        CAST                                          7  ~5      !0
          3        ASSIGN                                                   !1, ~5
   10     4      > FE_RESET_R                                       $7      !1, ->15
          5    > > FE_FETCH_R                                               $7, !2, ->15
   11     6    >   INIT_FCALL                                               'printf'
          7        SEND_VAL                                                 '%25s+%28%25s%29%0A'
          8        INIT_FCALL_BY_NAME                                       'item'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $8      
         11        SEND_VAR                                                 $8
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   10    14      > JMP                                                      ->5
         15    >   FE_FREE                                                  $7
   18    16      > RETURN                                                   1

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

End of function item

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.2 ms | 1395 KiB | 17 Q