3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array2CSV(array $array) { $sanitized = array(); foreach ($array as $col) { $col = str_replace(array('\\', '"'), array('\/', '\"'), $col); $sanitized[] = "\"$col\""; } return implode(',', $sanitized); } echo array2CSV(array('test', 'te"t\est'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NFQeL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'array2csv'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function array2csv:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/NFQeL
function name:  array2CSV
number of ops:  23
compiled vars:  !0 = $array, !1 = $sanitized, !2 = $col
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $4      !0, ->16
          3    > > FE_FETCH_R                                               $4, !2, ->16
    6     4    >   INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 <array>
          6        SEND_VAL                                                 <array>
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !2, $5
    7    10        ROPE_INIT                                     3  ~9      '%22'
         11        ROPE_ADD                                      1  ~9      ~9, !2
         12        ROPE_END                                      2  ~8      ~9, '%22'
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  ~8
    5    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $4
    9    17        INIT_FCALL                                               'implode'
         18        SEND_VAL                                                 '%2C'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $11     
         21      > RETURN                                                   $11
   10    22*     > RETURN                                                   null

End of function array2csv

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1399 KiB | 18 Q