3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = str_getcsv('"blah \" blah"|""', '|', '"', '\\'); var_dump($data); $fp = fopen('php://memory', 'w'); fputcsv($fp, $data, '|', '"', '"'); fseek($fp, 0); $csv = rtrim(stream_get_contents($fp), "\r\n"); fclose($fp); fputs(STDOUT, $csv . "\n"); # "blah \""
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i43b2
function name:  (null)
number of ops:  44
compiled vars:  !0 = $data, !1 = $fp, !2 = $csv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'str_getcsv'
          1        SEND_VAL                                                 '%22blah+%5C%22+blah%22%7C%22%22'
          2        SEND_VAL                                                 '%7C'
          3        SEND_VAL                                                 '%22'
          4        SEND_VAL                                                 '%5C'
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    4     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    6    10        INIT_FCALL                                               'fopen'
         11        SEND_VAL                                                 'php%3A%2F%2Fmemory'
         12        SEND_VAL                                                 'w'
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !1, $6
    7    15        INIT_FCALL                                               'fputcsv'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 '%7C'
         19        SEND_VAL                                                 '%22'
         20        SEND_VAL                                                 '%22'
         21        DO_ICALL                                                 
    8    22        INIT_FCALL                                               'fseek'
         23        SEND_VAR                                                 !1
         24        SEND_VAL                                                 0
         25        DO_ICALL                                                 
    9    26        INIT_FCALL                                               'rtrim'
         27        INIT_FCALL                                               'stream_get_contents'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $10     
         30        SEND_VAR                                                 $10
         31        SEND_VAL                                                 '%0D%0A'
         32        DO_ICALL                                         $11     
         33        ASSIGN                                                   !2, $11
   10    34        INIT_FCALL                                               'fclose'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
   11    37        INIT_FCALL                                               'fputs'
         38        FETCH_CONSTANT                                   ~14     'STDOUT'
         39        SEND_VAL                                                 ~14
         40        CONCAT                                           ~15     !2, '%0A'
         41        SEND_VAL                                                 ~15
         42        DO_ICALL                                                 
   13    43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.22 ms | 1396 KiB | 31 Q