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], ';'); echo '<br />'; } 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, ';'); echo '<br />'; } 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 = 25
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 10
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 51
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 46
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 46
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 10
Branch analysis from position: 21
Branch analysis from position: 10
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 51
Branch analysis from position: 37
Branch analysis from position: 51
filename:       /in/mdViS
function name:  (null)
number of ops:  56
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, ->25
   11     8    >   ASSIGN                                                   !2, 0
          9      > JMP                                                      ->18
   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                                                 
   14    16        ECHO                                                     '%3Cbr+%2F%3E'
   11    17        PRE_INC                                                  !2
         18    >   COUNT                                            ~13     !0
         19        IS_SMALLER                                               !2, ~13
         20      > JMPNZ                                                    ~14, ->10
   16    21    >   INIT_FCALL                                               'fclose'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > JMP                                                      ->29
   20    25    >   CONCAT                                           ~17     'Report-Datei+', !4
         26        CONCAT                                           ~18     ~17, '+konnte+nicht+geschrieben+werden.'
         27        ASSIGN_DIM                                               !3
         28        OP_DATA                                                  ~18
   23    29    >   ECHO                                                     'Zweitens%3A%3Cbr+%2F%3E%0A'
   25    30        ASSIGN                                                   !0, <array>
   30    31        INIT_FCALL                                               'fopen'
         32        SEND_VAL                                                 'php%3A%2F%2Foutput'
         33        SEND_VAL                                                 'w%2B'
         34        DO_ICALL                                         $20     
         35        ASSIGN                                                   !1, $20
   31    36      > JMPZ                                                     !1, ->51
   33    37    > > FE_RESET_R                                       $22     !0, ->46
         38    > > FE_FETCH_R                                               $22, !5, ->46
   35    39    >   INIT_FCALL                                               'fputcsv'
         40        SEND_VAR                                                 !1
         41        SEND_VAR                                                 !5
         42        SEND_VAL                                                 '%3B'
         43        DO_ICALL                                                 
   36    44        ECHO                                                     '%3Cbr+%2F%3E'
   33    45      > JMP                                                      ->38
         46    >   FE_FREE                                                  $22
   38    47        INIT_FCALL                                               'fclose'
         48        SEND_VAR                                                 !1
         49        DO_ICALL                                                 
         50      > JMP                                                      ->55
   42    51    >   CONCAT                                           ~26     'Report-Datei+', !4
         52        CONCAT                                           ~27     ~26, '+konnte+nicht+geschrieben+werden.'
         53        ASSIGN_DIM                                               !3
         54        OP_DATA                                                  ~27
   44    55    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.62 ms | 1400 KiB | 19 Q