3v4l.org

run code in 300+ PHP versions simultaneously
<?php $csv = <<<EOF "chinese test.","中文测试。" "chinese, test.","中文,测试。" "chinese test2","中文测试2" "chinese, test2","中文,测试2" EOF; $file = fopen('php://memory', 'a+b'); fwrite($file, $csv); fseek($file, 0, SEEK_SET); $result = []; while($row = fgetcsv($file, 0, ',', '"', '\\')) { if (is_array($row)) { $result[] = $row; } else { break; } } var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 17
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
filename:       /in/qSG5D
function name:  (null)
number of ops:  36
compiled vars:  !0 = $csv, !1 = $file, !2 = $result, !3 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%22chinese+test.%22%2C%22%E4%B8%AD%E6%96%87%E6%B5%8B%E8%AF%95%E3%80%82%22%0A%22chinese%2C+test.%22%2C%22%E4%B8%AD%E6%96%87%EF%BC%8C%E6%B5%8B%E8%AF%95%E3%80%82%22%0A%22chinese+test2%22%2C%22%E4%B8%AD%E6%96%87%E6%B5%8B%E8%AF%952%22%0A%22chinese%2C+test2%22%2C%22%E4%B8%AD%E6%96%87%EF%BC%8C%E6%B5%8B%E8%AF%952%22'
    9     1        INIT_FCALL                                               'fopen'
          2        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          3        SEND_VAL                                                 'a%2Bb'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   10     6        INIT_FCALL                                               'fwrite'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   11    10        INIT_FCALL                                               'fseek'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 0
         14        DO_ICALL                                                 
   12    15        ASSIGN                                                   !2, <array>
   13    16      > JMP                                                      ->23
   14    17    >   TYPE_CHECK                                  128          !3
         18      > JMPZ                                                     ~10, ->22
   15    19    >   ASSIGN_DIM                                               !2
         20        OP_DATA                                                  !3
         21      > JMP                                                      ->23
   17    22    > > JMP                                                      ->32
   13    23    >   INIT_FCALL                                               'fgetcsv'
         24        SEND_VAR                                                 !1
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 '%2C'
         27        SEND_VAL                                                 '%22'
         28        SEND_VAL                                                 '%5C'
         29        DO_ICALL                                         $12     
         30        ASSIGN                                           ~13     !3, $12
         31      > JMPNZ                                                    ~13, ->17
   20    32    >   INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.2 ms | 1400 KiB | 23 Q