3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = 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 ( (array) $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/I12Km
function name:  (null)
number of ops:  15
compiled vars:  !0 = $list, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        CAST                                          7  ~3      !0
          2      > FE_RESET_R                                       $4      ~3, ->13
          3    > > FE_FETCH_R                                               $4, !1, ->13
   11     4    >   INIT_FCALL                                               'printf'
          5        SEND_VAL                                                 '%25s+%28%25s%29%0A'
          6        INIT_FCALL_BY_NAME                                       'item'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   10    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $4
   18    14      > RETURN                                                   1

Function item:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I12Km
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:
151.27 ms | 1395 KiB | 17 Q