3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => [ 5 => 5 ], 1 => [ 7 => 7 ], 2 => [ 6 => 9 ], 3 => [ 2 => 2 ], 4 => [ 9 => 10 ], ]; foreach($array as $item) { //Atende ao objetivo, porem a função each foi descontinuada no PHP 7.2. //list($key, $value) = each($item); //Alternativamente você pode fazer. $key = key($item); $value = current($item); echo "$key => $value\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/5R04k
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $item, !2 = $key, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   20     1      > FE_RESET_R                                       $5      !0, ->17
          2    > > FE_FETCH_R                                               $5, !1, ->17
   24     3    >   INIT_FCALL                                               'key'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   25     7        INIT_FCALL                                               'current'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !3, $8
   27    11        ROPE_INIT                                     4  ~11     !2
         12        ROPE_ADD                                      1  ~11     ~11, '+%3D%3E+'
         13        ROPE_ADD                                      2  ~11     ~11, !3
         14        ROPE_END                                      3  ~10     ~11, '%0A'
         15        ECHO                                                     ~10
   20    16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $5
   28    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.66 ms | 1016 KiB | 15 Q