3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array( 1=>array('First','word'), 5=>array('Second','word'), 6=>array('Third','word'), 7=>array('-','non-word'), 8=>array('Fourth','word'), 10=>array('Fifth','word') ); foreach ($array as $key => $value) { echo $value[0]; if (!isset($array[$key+1])) { echo PHP_EOL; } else if ($array[$key+1][1] === 'word' && $array[$key][1] !== 'non-word') { echo ' '; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
Branch analysis from position: 21
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/IFVa0
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1      > FE_RESET_R                                       $4      !0, ->24
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->24
          3    >   ASSIGN                                                   !2, ~5
   12     4        FETCH_DIM_R                                      ~7      !1, 0
          5        ECHO                                                     ~7
   13     6        ADD                                              ~8      !2, 1
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      !0, ~8
          8        BOOL_NOT                                         ~10     ~9
          9      > JMPZ                                                     ~10, ->12
   14    10    >   ECHO                                                     '%0A'
   13    11      > JMP                                                      ->23
   15    12    >   ADD                                              ~11     !2, 1
         13        FETCH_DIM_R                                      ~12     !0, ~11
         14        FETCH_DIM_R                                      ~13     ~12, 1
         15        IS_IDENTICAL                                     ~14     ~13, 'word'
         16      > JMPZ_EX                                          ~14     ~14, ->21
         17    >   FETCH_DIM_R                                      ~15     !0, !2
         18        FETCH_DIM_R                                      ~16     ~15, 1
         19        IS_NOT_IDENTICAL                                 ~17     ~16, 'non-word'
         20        BOOL                                             ~14     ~17
         21    > > JMPZ                                                     ~14, ->23
   16    22    >   ECHO                                                     '+'
   11    23    > > JMP                                                      ->2
         24    >   FE_FREE                                                  $4
   18    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.13 ms | 1008 KiB | 13 Q