3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * The value of the $escape parameter doesn't matter * unless it's set to the one character that makes sense * then it f's up the escaping and produces invalid CSV data * */ $fh = fopen('php://stdout', 'w'); fputcsv($fh, ['using default', 'a,"b'], ',', '"'); fputcsv($fh, ['using " ', 'a,"b'], ',', '"', '"'); fputcsv($fh, ['using x ', 'a,"b'], ',', '"', 'x'); fputcsv($fh, ['using \\ ', 'a,"b'], ',', '"', '\\');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LKkfW
function name:  (null)
number of ops:  33
compiled vars:  !0 = $fh
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'fopen'
          1        SEND_VAL                                                     'php%3A%2F%2Fstdout'
          2        SEND_VAL                                                     'w'
          3        DO_ICALL                                             $1      
          4        ASSIGN                                                       !0, $1
   10     5        INIT_FCALL                                                   'fputcsv'
          6        SEND_VAR                                                     !0
          7        SEND_VAL                                                     <array>
          8        SEND_VAL                                                     '%2C'
          9        SEND_VAL                                                     '%22'
         10        DO_ICALL                                                     
   11    11        INIT_FCALL                                                   'fputcsv'
         12        SEND_VAR                                                     !0
         13        SEND_VAL                                                     <array>
         14        SEND_VAL                                                     '%2C'
         15        SEND_VAL                                                     '%22'
         16        SEND_VAL                                                     '%22'
         17        DO_ICALL                                                     
   12    18        INIT_FCALL                                                   'fputcsv'
         19        SEND_VAR                                                     !0
         20        SEND_VAL                                                     <array>
         21        SEND_VAL                                                     '%2C'
         22        SEND_VAL                                                     '%22'
         23        SEND_VAL                                                     'x'
         24        DO_ICALL                                                     
   13    25        INIT_FCALL                                                   'fputcsv'
         26        SEND_VAR                                                     !0
         27        SEND_VAL                                                     <array>
         28        SEND_VAL                                                     '%2C'
         29        SEND_VAL                                                     '%22'
         30        SEND_VAL                                                     '%5C'
         31        DO_ICALL                                                     
         32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.58 ms | 2651 KiB | 15 Q