3v4l.org

run code in 300+ PHP versions simultaneously
Erstens:<br /> <?php $csvOut = array( array('eins', 'bla', 'blubb'), array('zwei', 'bla', 'blubb'), ); $f = fopen('php://output', 'w+'); if ($f) { for ($cnt = 0; $cnt < count($csvOut); $cnt++) { fputcsv($f, $csvOut[$cnt], ';'); } fclose($f); } else { $error[] = "Report-Datei ".$csvPath." konnte nicht geschrieben werden."; } ?> Zweitens:<br /> <?php $csvOut = array( array('eins', 'bla', 'blubb'), array('zwei', 'bla', 'blubb'), ); $f = fopen('php://output', 'w+'); if ($f) { foreach($csvOut as $line) { fputcsv($f, $line, ';'); } fclose($f); } else { $error[] = "Report-Datei ".$csvPath." konnte nicht geschrieben werden."; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 49
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 44
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
Branch analysis from position: 10
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 49
Branch analysis from position: 36
Branch analysis from position: 49
filename:       /in/GhoRX
function name:  (null)
number of ops:  54
compiled vars:  !0 = $csvOut, !1 = $f, !2 = $cnt, !3 = $error, !4 = $csvPath, !5 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'Erstens%3A%3Cbr+%2F%3E%0A'
    3     1        ASSIGN                                                   !0, <array>
    8     2        INIT_FCALL                                               'fopen'
          3        SEND_VAL                                                 'php%3A%2F%2Foutput'
          4        SEND_VAL                                                 'w%2B'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !1, $7
    9     7      > JMPZ                                                     !1, ->24
   11     8    >   ASSIGN                                                   !2, 0
          9      > JMP                                                      ->17
   13    10    >   INIT_FCALL                                               'fputcsv'
         11        SEND_VAR                                                 !1
         12        FETCH_DIM_R                                      ~10     !0, !2
         13        SEND_VAL                                                 ~10
         14        SEND_VAL                                                 '%3B'
         15        DO_ICALL                                                 
   11    16        PRE_INC                                                  !2
         17    >   COUNT                                            ~13     !0
         18        IS_SMALLER                                               !2, ~13
         19      > JMPNZ                                                    ~14, ->10
   15    20    >   INIT_FCALL                                               'fclose'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > JMP                                                      ->28
   19    24    >   CONCAT                                           ~17     'Report-Datei+', !4
         25        CONCAT                                           ~18     ~17, '+konnte+nicht+geschrieben+werden.'
         26        ASSIGN_DIM                                               !3
         27        OP_DATA                                                  ~18
   22    28    >   ECHO                                                     'Zweitens%3A%3Cbr+%2F%3E%0A'
   24    29        ASSIGN                                                   !0, <array>
   29    30        INIT_FCALL                                               'fopen'
         31        SEND_VAL                                                 'php%3A%2F%2Foutput'
         32        SEND_VAL                                                 'w%2B'
         33        DO_ICALL                                         $20     
         34        ASSIGN                                                   !1, $20
   30    35      > JMPZ                                                     !1, ->49
   32    36    > > FE_RESET_R                                       $22     !0, ->44
         37    > > FE_FETCH_R                                               $22, !5, ->44
   34    38    >   INIT_FCALL                                               'fputcsv'
         39        SEND_VAR                                                 !1
         40        SEND_VAR                                                 !5
         41        SEND_VAL                                                 '%3B'
         42        DO_ICALL                                                 
   32    43      > JMP                                                      ->37
         44    >   FE_FREE                                                  $22
   36    45        INIT_FCALL                                               'fclose'
         46        SEND_VAR                                                 !1
         47        DO_ICALL                                                 
         48      > JMP                                                      ->53
   40    49    >   CONCAT                                           ~26     'Report-Datei+', !4
         50        CONCAT                                           ~27     ~26, '+konnte+nicht+geschrieben+werden.'
         51        ASSIGN_DIM                                               !3
         52        OP_DATA                                                  ~27
   42    53    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.79 ms | 1400 KiB | 19 Q