3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a =[[1],[2],[2],[4],[5],[5],[3]]; Foreach($a as $b){ Echo $b[0]. "\n"; If(next($a)[0] != $b[0]) echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/VSJeQ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $3      !0, ->15
          2    > > FE_FETCH_R                                               $3, !1, ->15
    6     3    >   FETCH_DIM_R                                      ~4      !1, 0
          4        CONCAT                                           ~5      ~4, '%0A'
          5        ECHO                                                     ~5
    7     6        INIT_FCALL                                               'next'
          7        SEND_REF                                                 !0
          8        DO_ICALL                                         $6      
          9        FETCH_DIM_R                                      ~7      $6, 0
         10        FETCH_DIM_R                                      ~8      !1, 0
         11        IS_NOT_EQUAL                                             ~7, ~8
         12      > JMPZ                                                     ~9, ->14
         13    >   ECHO                                                     '%0A'
    5    14    > > JMP                                                      ->2
         15    >   FE_FREE                                                  $3
    8    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.29 ms | 1001 KiB | 14 Q