3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lost = array("A","B","C","D"); $list = $lost; # cow-count2 // $list = &$lost; # refcount2 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 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/21DG9
function name:  (null)
number of ops:  15
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
    8     2      > FE_RESET_R                                       $5      !1, ->13
          3    > > FE_FETCH_R                                               $5, !2, ->13
    9     4    >   INIT_FCALL                                               'printf'
          5        SEND_VAL                                                 '%25s+%28%25s%29%0A'
          6        INIT_FCALL_BY_NAME                                       'item'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
    8    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $5
   16    14      > RETURN                                                   1

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

End of function item

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.46 ms | 1387 KiB | 17 Q