3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1, 2, 3, 4); echo key($arr), "=>", current($arr), "\r\n"; foreach ($arr as $key => $row) { echo key($arr), "=>", current($arr), "\r\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/2fMH9
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $row, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'key'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ECHO                                                     $4
          5        ECHO                                                     '%3D%3E'
          6        INIT_FCALL                                               'current'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
         10        ECHO                                                     '%0D%0A'
    5    11      > FE_RESET_R                                       $6      !0, ->25
         12    > > FE_FETCH_R                                       ~7      $6, !1, ->25
         13    >   ASSIGN                                                   !2, ~7
    7    14        INIT_FCALL                                               'key'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $9      
         17        ECHO                                                     $9
         18        ECHO                                                     '%3D%3E'
         19        INIT_FCALL                                               'current'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $10     
         22        ECHO                                                     $10
         23        ECHO                                                     '%0D%0A'
    5    24      > JMP                                                      ->12
         25    >   FE_FREE                                                  $6
    8    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.8 ms | 1395 KiB | 17 Q