3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '#PROGRAM "Accounting company" 98.2 #GENERATED 2020715 "SE"'; $quoted = false; $index = 0; $data = []; $rows = explode("\n", $str); foreach($rows as $row) { $temp = []; for ($i = 0; $i < strlen($row); $i++) { if ($row[$i] === "\"") $quoted = !$quoted; if ($row[$i] === " " && !$quoted) { $index++; continue; } $temp[$index] = ($temp[$index] ?? "") . $row[$i]; } $data[] = array_values($temp); } var_dump($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 44
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 44
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 14
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 14
Branch analysis from position: 38
Branch analysis from position: 14
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 14
Branch analysis from position: 38
Branch analysis from position: 14
Branch analysis from position: 24
Branch analysis from position: 19
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/TNAYo
function name:  (null)
number of ops:  49
compiled vars:  !0 = $str, !1 = $quoted, !2 = $index, !3 = $data, !4 = $rows, !5 = $row, !6 = $temp, !7 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%23PROGRAM+++%22Accounting+company%22++++98.2%0A+%23GENERATED+++++2020715+%22SE%22'
    7     1        ASSIGN                                                   !1, <false>
    8     2        ASSIGN                                                   !2, 0
    9     3        ASSIGN                                                   !3, <array>
   10     4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%0A'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $12     
          8        ASSIGN                                                   !4, $12
   12     9      > FE_RESET_R                                       $14     !4, ->44
         10    > > FE_FETCH_R                                               $14, !5, ->44
   13    11    >   ASSIGN                                                   !6, <array>
   14    12        ASSIGN                                                   !7, 0
         13      > JMP                                                      ->35
   15    14    >   FETCH_DIM_R                                      ~17     !5, !7
         15        IS_IDENTICAL                                             ~17, '%22'
         16      > JMPZ                                                     ~18, ->19
         17    >   BOOL_NOT                                         ~19     !1
         18        ASSIGN                                                   !1, ~19
   16    19    >   FETCH_DIM_R                                      ~21     !5, !7
         20        IS_IDENTICAL                                     ~22     ~21, '+'
         21      > JMPZ_EX                                          ~22     ~22, ->24
         22    >   BOOL_NOT                                         ~23     !1
         23        BOOL                                             ~22     ~23
         24    > > JMPZ                                                     ~22, ->27
   17    25    >   PRE_INC                                                  !2
   18    26      > JMP                                                      ->34
   21    27    >   FETCH_DIM_IS                                     ~26     !6, !2
         28        COALESCE                                         ~27     ~26
         29        QM_ASSIGN                                        ~27     ''
         30        FETCH_DIM_R                                      ~28     !5, !7
         31        CONCAT                                           ~29     ~27, ~28
         32        ASSIGN_DIM                                               !6, !2
         33        OP_DATA                                                  ~29
   14    34    >   PRE_INC                                                  !7
         35    >   STRLEN                                           ~31     !5
         36        IS_SMALLER                                               !7, ~31
         37      > JMPNZ                                                    ~32, ->14
   24    38    >   INIT_FCALL                                               'array_values'
         39        SEND_VAR                                                 !6
         40        DO_ICALL                                         $34     
         41        ASSIGN_DIM                                               !3
         42        OP_DATA                                                  $34
   12    43      > JMP                                                      ->10
         44    >   FE_FREE                                                  $14
   27    45        INIT_FCALL                                               'var_dump'
         46        SEND_VAR                                                 !3
         47        DO_ICALL                                                 
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
267.34 ms | 1012 KiB | 16 Q