3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.34 ms | 1400 KiB | 27 Q