3v4l.org

run code in 300+ PHP versions simultaneously
<?php $handle = fopen('php://memory', 'w+b'); fputcsv($handle, [ 'foo bar\\', # 1 'baz quz', # 2 'x', # 3 'y', # 4 'z', # 5 'foo\\\\",bar' # 6 ]); rewind($handle); var_dump(fgetcsv($handle)); // array(6) { // [0]=> string(18) "foo bar\",baz quz"" # 1 // [1]=> string(1) "x" # 2 (was # 3) // [2]=> string(1) "y" # 3 (was # 4) // [3]=> string(1) "z" # 4 (was # 5) // [4]=> string(5) "foo\\" # 5 // [5]=> string(4) "bar"" # 6 // }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LTnC1
function name:  (null)
number of ops:  19
compiled vars:  !0 = $handle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          2        SEND_VAL                                                 'w%2Bb'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    5     5        INIT_FCALL                                               'fputcsv'
          6        SEND_VAR                                                 !0
    6     7        SEND_VAL                                                 <array>
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'rewind'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   16    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'fgetcsv'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                                 
   25    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.62 ms | 1399 KiB | 23 Q