3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fp = fopen('php://output', 'w'); $input = ['some', 'random "stuff"', 'and \"shite\"', 'or \\\"more\\\"']; foreach ($input as &$field) { $field = preg_replace('~\\+"~', '"', $field); var_dump(preg_replace('~\\\\+"~', '"', $field)); } fputcsv($fp, $input); fclose($fp);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/DjUOf
function name:  (null)
number of ops:  32
compiled vars:  !0 = $fp, !1 = $input, !2 = $field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Foutput'
          2        SEND_VAL                                                 'w'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        ASSIGN                                                   !1, <array>
    6     6      > FE_RESET_RW                                      $6      !1, ->23
          7    > > FE_FETCH_RW                                              $6, !2, ->23
    7     8    >   INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%7E%5C%2B%22%7E'
         10        SEND_VAL                                                 '%22'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
    8    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'preg_replace'
         16        SEND_VAL                                                 '%7E%5C%5C%2B%22%7E'
         17        SEND_VAL                                                 '%22'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
    6    22      > JMP                                                      ->7
         23    >   FE_FREE                                                  $6
   11    24        INIT_FCALL                                               'fputcsv'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
   12    28        INIT_FCALL                                               'fclose'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.21 ms | 1396 KiB | 23 Q