3v4l.org

run code in 500+ PHP versions simultaneously
<?php $exploded = array( '1', 'Lorem ipsum', 'dolor sit', 'amet', '2', 'consectetur', 'adipiscing elit', 'adipiscing elit', '3', 'Integer nec', 'odio' ); $array = array(); $a = false; $count = 1; $arraycount = count($exploded); for ($i = 0; $i < $arraycount; $i++) { $countstring = $count + 1; $countstring = (string)$countstring; if ($exploded[$i] == $count) { $array[$count][] = $exploded[$i]; $a = true; } elseif ($a == true && $exploded[$i] == (string)$count) { $array[$count][] = $exploded[$i]; } elseif ($a == true && $exploded[$i + 1] != $countstring) { $array[$count][] = $exploded[$i]; } elseif ($a == true && $exploded[$i + 1] == $countstring) { $array[$count][] = $exploded[$i]; $count++; $a = false; } } echo '<pre>'; print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 8
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 8
Branch analysis from position: 61
Branch analysis from position: 8
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 35, Position 2 = 39
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 45
2 jumps found. (Code = 46) Position 1 = 47, Position 2 = 51
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 58
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 8
Branch analysis from position: 61
Branch analysis from position: 8
Branch analysis from position: 58
Branch analysis from position: 51
Branch analysis from position: 39
Branch analysis from position: 27
filename:       /in/EqnIN
function name:  (null)
number of ops:  66
compiled vars:  !0 = $exploded, !1 = $array, !2 = $a, !3 = $count, !4 = $arraycount, !5 = $i, !6 = $countstring
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   17     1        ASSIGN                                                       !1, <array>
   18     2        ASSIGN                                                       !2, <false>
   19     3        ASSIGN                                                       !3, 1
   20     4        COUNT                                                ~11     !0
          5        ASSIGN                                                       !4, ~11
   22     6        ASSIGN                                                       !5, 0
          7      > JMP                                                          ->59
   24     8    >   ADD                                                  ~14     !3, 1
          9        ASSIGN                                                       !6, ~14
   25    10        CAST                                              6  ~16     !6
         11        ASSIGN                                                       !6, ~16
   26    12        FETCH_DIM_R                                          ~18     !0, !5
         13        IS_EQUAL                                                     !3, ~18
         14      > JMPZ                                                         ~19, ->21
   28    15    >   FETCH_DIM_R                                          ~22     !0, !5
         16        FETCH_DIM_W                                          $20     !1, !3
         17        ASSIGN_DIM                                                   $20
         18        OP_DATA                                                      ~22
   29    19        ASSIGN                                                       !2, <true>
   26    20      > JMP                                                          ->58
   31    21    >   IS_EQUAL                                             ~24     !2, <true>
         22      > JMPZ_EX                                              ~24     ~24, ->27
         23    >   FETCH_DIM_R                                          ~25     !0, !5
         24        CAST                                              6  ~26     !3
         25        IS_EQUAL                                             ~27     ~25, ~26
         26        BOOL                                                 ~24     ~27
         27    > > JMPZ                                                         ~24, ->33
   33    28    >   FETCH_DIM_R                                          ~30     !0, !5
         29        FETCH_DIM_W                                          $28     !1, !3
         30        ASSIGN_DIM                                                   $28
         31        OP_DATA                                                      ~30
   31    32      > JMP                                                          ->58
   35    33    >   IS_EQUAL                                             ~31     !2, <true>
         34      > JMPZ_EX                                              ~31     ~31, ->39
         35    >   ADD                                                  ~32     !5, 1
         36        FETCH_DIM_R                                          ~33     !0, ~32
         37        IS_NOT_EQUAL                                         ~34     !6, ~33
         38        BOOL                                                 ~31     ~34
         39    > > JMPZ                                                         ~31, ->45
   37    40    >   FETCH_DIM_R                                          ~37     !0, !5
         41        FETCH_DIM_W                                          $35     !1, !3
         42        ASSIGN_DIM                                                   $35
         43        OP_DATA                                                      ~37
   35    44      > JMP                                                          ->58
   39    45    >   IS_EQUAL                                             ~38     !2, <true>
         46      > JMPZ_EX                                              ~38     ~38, ->51
         47    >   ADD                                                  ~39     !5, 1
         48        FETCH_DIM_R                                          ~40     !0, ~39
         49        IS_EQUAL                                             ~41     !6, ~40
         50        BOOL                                                 ~38     ~41
         51    > > JMPZ                                                         ~38, ->58
   41    52    >   FETCH_DIM_R                                          ~44     !0, !5
         53        FETCH_DIM_W                                          $42     !1, !3
         54        ASSIGN_DIM                                                   $42
         55        OP_DATA                                                      ~44
   42    56        PRE_INC                                                      !3
   43    57        ASSIGN                                                       !2, <false>
   22    58    >   PRE_INC                                                      !5
         59    >   IS_SMALLER                                                   !5, !4
         60      > JMPNZ                                                        ~48, ->8
   47    61    >   ECHO                                                         '%3Cpre%3E'
   48    62        INIT_FCALL                                                   'print_r'
         63        SEND_VAR                                                     !1
         64        DO_ICALL                                                     
         65      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.48 ms | 2457 KiB | 14 Q