3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3,4,5]; next($array); next($array); var_dump(current($array)); // 2 foreach ($array as $item) { continue; // iterate over array } var_dump(current($array)); // 2. В PHP 5.5 будет NULL
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/gJQrk
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'next'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'next'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'current'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
    8    13      > FE_RESET_R                                       $7      !0, ->17
         14    > > FE_FETCH_R                                               $7, !1, ->17
    9    15    > > JMP                                                      ->14
    8    16*       JMP                                                      ->14
         17    >   FE_FREE                                                  $7
   12    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'current'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.01 ms | 1395 KiB | 19 Q