3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ ['a', 'b"and"c'], ['d', 'e,\'f'] ]; $line = ''; foreach ($rows as $row) { $line .= '"' . implode('","', str_replace('"', '""', $row)) . '"' . "\r\n"; } echo $line;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/YWTI4
function name:  (null)
number of ops:  21
compiled vars:  !0 = $rows, !1 = $line, !2 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, ''
    9     2      > FE_RESET_R                                       $5      !0, ->18
          3    > > FE_FETCH_R                                               $5, !2, ->18
   10     4    >   INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '%22%2C%22'
          6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '%22'
          8        SEND_VAL                                                 '%22%22'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                         $7      
         13        CONCAT                                           ~8      '%22', $7
         14        CONCAT                                           ~9      ~8, '%22'
         15        CONCAT                                           ~10     ~9, '%0D%0A'
         16        ASSIGN_OP                                     8          !1, ~10
    9    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $5
   12    19        ECHO                                                     !1
   13    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.41 ms | 1399 KiB | 17 Q