3v4l.org

run code in 300+ PHP versions simultaneously
<?php $flags = [ 'READ_AHEAD' => SplFileObject::READ_AHEAD, 'READ_AHEAD | DROP_NEW_LINE' => SplFileObject::READ_AHEAD | SplFileObject::DROP_NEW_LINE, 'READ_AHEAD | SKIP_EMPTY' => SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY, 'READ_AHEAD | SKIP_EMPTY | DROP_NEW_LINE' => SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE, ]; $file = new SplTempFileObject(); $file->fwrite("1\n\n3\n"); foreach ([SplFileObject::READ_AHEAD, 0] as $readAhead) { foreach ([SplFileObject::SKIP_EMPTY, 0] as $skipEmpty) { foreach ([SplFileObject::DROP_NEW_LINE, 0] as $dropNewLine) { $file->rewind(); $file->setFlags( SplFileObject::READ_CSV | $readAhead | $skipEmpty | $dropNewLine ); printf( " %s | %s | %s | %s\n", // SKIP_EMPTY $readAhead ? 'READ_AHEAD' : ' ', $skipEmpty ? 'SKIP_EMPTY' : ' ', // DROP_NEW_LINE $dropNewLine ? 'DROP_NEW_LINE' : ' ', json_encode(array_values(iterator_to_array($file))) ); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 54
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 54
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 52
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 52
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 50
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 50
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
Branch analysis from position: 36
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
Branch analysis from position: 31
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 50
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 52
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
filename:       /in/25GRZ
function name:  (null)
number of ops:  56
compiled vars:  !0 = $flags, !1 = $file, !2 = $readAhead, !3 = $skipEmpty, !4 = $dropNewLine
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        NEW                                              $6      'SplTempFileObject'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   12     4        INIT_METHOD_CALL                                         !1, 'fwrite'
          5        SEND_VAL_EX                                              '1%0A%0A3%0A'
          6        DO_FCALL                                      0          
   13     7      > FE_RESET_R                                       $10     <array>, ->54
          8    > > FE_FETCH_R                                               $10, !2, ->54
   14     9    > > FE_RESET_R                                       $11     <array>, ->52
         10    > > FE_FETCH_R                                               $11, !3, ->52
   15    11    > > FE_RESET_R                                       $12     <array>, ->50
         12    > > FE_FETCH_R                                               $12, !4, ->50
   16    13    >   INIT_METHOD_CALL                                         !1, 'rewind'
         14        DO_FCALL                                      0          
   17    15        INIT_METHOD_CALL                                         !1, 'setFlags'
   18    16        BW_OR                                            ~14     !2, 8
         17        BW_OR                                            ~15     !3, ~14
         18        BW_OR                                            ~16     !4, ~15
         19        SEND_VAL_EX                                              ~16
         20        DO_FCALL                                      0          
   20    21        INIT_FCALL                                               'printf'
   21    22        SEND_VAL                                                 '+%25s+%7C+%25s+%7C+%25s+%7C+%25s%0A'
   22    23      > JMPZ                                                     !2, ->26
         24    >   QM_ASSIGN                                        ~18     'READ_AHEAD'
         25      > JMP                                                      ->27
         26    >   QM_ASSIGN                                        ~18     '++++++++++'
         27    >   SEND_VAL                                                 ~18
   23    28      > JMPZ                                                     !3, ->31
         29    >   QM_ASSIGN                                        ~19     'SKIP_EMPTY'
         30      > JMP                                                      ->32
         31    >   QM_ASSIGN                                        ~19     '++++++++++'
         32    >   SEND_VAL                                                 ~19
   25    33      > JMPZ                                                     !4, ->36
         34    >   QM_ASSIGN                                        ~20     'DROP_NEW_LINE'
         35      > JMP                                                      ->37
         36    >   QM_ASSIGN                                        ~20     '+++++++++++++'
         37    >   SEND_VAL                                                 ~20
   26    38        INIT_FCALL                                               'json_encode'
         39        INIT_FCALL                                               'array_values'
         40        INIT_FCALL                                               'iterator_to_array'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $21     
         43        SEND_VAR                                                 $21
         44        DO_ICALL                                         $22     
         45        SEND_VAR                                                 $22
         46        DO_ICALL                                         $23     
         47        SEND_VAR                                                 $23
         48        DO_ICALL                                                 
   15    49      > JMP                                                      ->12
         50    >   FE_FREE                                                  $12
   14    51      > JMP                                                      ->10
         52    >   FE_FREE                                                  $11
   13    53      > JMP                                                      ->8
         54    >   FE_FREE                                                  $10
   30    55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.38 ms | 1400 KiB | 21 Q