3v4l.org

run code in 300+ PHP versions simultaneously
<?php $delimiter = ','; $enclosure = '"'; $escape_char = "@"; $row_before = ["{$enclosure}{$escape_char}{$escape_char}{$enclosure}{$delimiter}{$enclosure}B{$enclosure}"]; print "\nBEFORE:\n"; var_export($row_before); print "\n"; $fh = fopen($file = 'php://temp', 'rb+'); # fputcsv($fh,$row_before,$delimiter,$enclosure, $escape_char); fwrite($fh, '"""@@"",""B"""'); rewind($fh); $row_plain = fread($fh, 1000); print "\nPLAIN:\n"; var_export($row_plain); print "\n"; rewind($fh); $row_after = fgetcsv($fh, 500,$delimiter,$enclosure, $escape_char); print "\nAFTER:\n"; var_export($row_after); print "\n\n"; fclose($fh);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mjQRi
function name:  (null)
number of ops:  61
compiled vars:  !0 = $delimiter, !1 = $enclosure, !2 = $escape_char, !3 = $row_before, !4 = $fh, !5 = $file, !6 = $row_plain, !7 = $row_after
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2C'
    4     1        ASSIGN                                                   !1, '%22'
    5     2        ASSIGN                                                   !2, '%40'
    7     3        ROPE_INIT                                     8  ~12     !1
          4        ROPE_ADD                                      1  ~12     ~12, !2
          5        ROPE_ADD                                      2  ~12     ~12, !2
          6        ROPE_ADD                                      3  ~12     ~12, !1
          7        ROPE_ADD                                      4  ~12     ~12, !0
          8        ROPE_ADD                                      5  ~12     ~12, !1
          9        ROPE_ADD                                      6  ~12     ~12, 'B'
         10        ROPE_END                                      7  ~11     ~12, !1
         11        INIT_ARRAY                                       ~16     ~11
         12        ASSIGN                                                   !3, ~16
    9    13        ECHO                                                     '%0ABEFORE%3A%0A'
   10    14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
   11    17        ECHO                                                     '%0A'
   13    18        INIT_FCALL                                               'fopen'
         19        ASSIGN                                           ~19     !5, 'php%3A%2F%2Ftemp'
         20        SEND_VAL                                                 ~19
         21        SEND_VAL                                                 'rb%2B'
         22        DO_ICALL                                         $20     
         23        ASSIGN                                                   !4, $20
   18    24        INIT_FCALL                                               'fwrite'
         25        SEND_VAR                                                 !4
         26        SEND_VAL                                                 '%22%22%22%40%40%22%22%2C%22%22B%22%22%22'
         27        DO_ICALL                                                 
   20    28        INIT_FCALL                                               'rewind'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                                 
   22    31        INIT_FCALL                                               'fread'
         32        SEND_VAR                                                 !4
         33        SEND_VAL                                                 1000
         34        DO_ICALL                                         $24     
         35        ASSIGN                                                   !6, $24
   24    36        ECHO                                                     '%0APLAIN%3A%0A'
   25    37        INIT_FCALL                                               'var_export'
         38        SEND_VAR                                                 !6
         39        DO_ICALL                                                 
   26    40        ECHO                                                     '%0A'
   28    41        INIT_FCALL                                               'rewind'
         42        SEND_VAR                                                 !4
         43        DO_ICALL                                                 
   30    44        INIT_FCALL                                               'fgetcsv'
         45        SEND_VAR                                                 !4
         46        SEND_VAL                                                 500
         47        SEND_VAR                                                 !0
         48        SEND_VAR                                                 !1
         49        SEND_VAR                                                 !2
         50        DO_ICALL                                         $28     
         51        ASSIGN                                                   !7, $28
   32    52        ECHO                                                     '%0AAFTER%3A%0A'
   33    53        INIT_FCALL                                               'var_export'
         54        SEND_VAR                                                 !7
         55        DO_ICALL                                                 
   34    56        ECHO                                                     '%0A%0A'
   36    57        INIT_FCALL                                               'fclose'
         58        SEND_VAR                                                 !4
         59        DO_ICALL                                                 
         60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.28 ms | 1400 KiB | 27 Q