3v4l.org

run code in 500+ PHP versions simultaneously
<?php $fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry'); reset($fruit); while (list($key, $val) = each($fruit)) { echo "$key => $val\n"; } echo '-----------------',PHP_EOL; foreach( $fruit as $key => $val ) { echo "$key => $val\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/t8mZI
function name:  (null)
number of ops:  31
compiled vars:  !0 = $fruit, !1 = $key, !2 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        INIT_FCALL                                                   'reset'
          2        SEND_REF                                                     !0
          3        DO_ICALL                                                     
    6     4      > JMP                                                          ->10
    7     5    >   ROPE_INIT                                         4  ~6      !1
          6        ROPE_ADD                                          1  ~6      ~6, '+%3D%3E+'
          7        ROPE_ADD                                          2  ~6      ~6, !2
          8        ROPE_END                                          3  ~5      ~6, '%0A'
          9        ECHO                                                         ~5
    6    10    >   INIT_FCALL_BY_NAME                                           'each'
         11        SEND_VAR_EX                                                  !0
         12        DO_FCALL                                          0  $8      
         13        FETCH_LIST_R                                         $9      $8, 0
         14        ASSIGN                                                       !1, $9
         15        FETCH_LIST_R                                         $11     $8, 1
         16        ASSIGN                                                       !2, $11
         17      > JMPNZ                                                        $8, ->5
   10    18    >   ECHO                                                         '-----------------'
         19        ECHO                                                         '%0A'
   11    20      > FE_RESET_R                                           $13     !0, ->29
         21    > > FE_FETCH_R                                           ~14     $13, !2, ->29
         22    >   ASSIGN                                                       !1, ~14
   12    23        ROPE_INIT                                         4  ~17     !1
         24        ROPE_ADD                                          1  ~17     ~17, '+%3D%3E+'
         25        ROPE_ADD                                          2  ~17     ~17, !2
         26        ROPE_END                                          3  ~16     ~17, '%0A'
         27        ECHO                                                         ~16
   11    28      > JMP                                                          ->21
         29    >   FE_FREE                                                      $13
   13    30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
229.5 ms | 3244 KiB | 14 Q