3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ['', '"', 'foo"', '\\"', '\\', 'foo\\']; $input = fopen('php://temp,', 'w+'); fputcsv($input, $data, ',', '"', '\\'); rewind($input); $csv = stream_get_contents($input); var_dump($csv); $output = fopen('php://temp', 'r+'); fwrite($output, $csv); rewind($output); var_dump($parsed = fgetcsv($output, 0, ',', '"', '\\'), $data === $parsed);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/reb5N
function name:  (null)
number of ops:  49
compiled vars:  !0 = $data, !1 = $input, !2 = $csv, !3 = $output, !4 = $parsed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'fopen'
          2        SEND_VAL                                                 'php%3A%2F%2Ftemp%2C'
          3        SEND_VAL                                                 'w%2B'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    5     6        INIT_FCALL                                               'fputcsv'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%2C'
         10        SEND_VAL                                                 '%22'
         11        SEND_VAL                                                 '%5C'
         12        DO_ICALL                                                 
    6    13        INIT_FCALL                                               'rewind'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    7    16        INIT_FCALL                                               'stream_get_contents'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !2, $10
    9    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   11    23        INIT_FCALL                                               'fopen'
         24        SEND_VAL                                                 'php%3A%2F%2Ftemp'
         25        SEND_VAL                                                 'r%2B'
         26        DO_ICALL                                         $13     
         27        ASSIGN                                                   !3, $13
   12    28        INIT_FCALL                                               'fwrite'
         29        SEND_VAR                                                 !3
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                                 
   13    32        INIT_FCALL                                               'rewind'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
   15    35        INIT_FCALL                                               'var_dump'
         36        INIT_FCALL                                               'fgetcsv'
         37        SEND_VAR                                                 !3
         38        SEND_VAL                                                 0
         39        SEND_VAL                                                 '%2C'
         40        SEND_VAL                                                 '%22'
         41        SEND_VAL                                                 '%5C'
         42        DO_ICALL                                         $17     
         43        ASSIGN                                           ~18     !4, $17
         44        SEND_VAL                                                 ~18
         45        IS_IDENTICAL                                     ~19     !0, !4
         46        SEND_VAL                                                 ~19
         47        DO_ICALL                                                 
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.36 ms | 1400 KiB | 27 Q