3v4l.org

run code in 500+ PHP versions simultaneously
<?php $delimiter = ','; $enclosure = '"'; $escape_char = "\\"; $row_before = ['A', json_encode(['a', '\\', 'b']), 'B']; print "\nBEFORE:\n"; var_export($row_before); print "\n"; $fh = fopen($file = 'php://temp', 'rb+'); fputcsv($fh,$row_before,$delimiter,$enclosure, $escape_char); 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/Svt7m
function name:  (null)
number of ops:  48
compiled vars:  !0 = $delimiter, !1 = $enclosure, !2 = $escape_char, !3 = $row_before, !4 = $fh, !5 = $file, !6 = $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, '%5C'
    7     3        INIT_ARRAY                                           ~10     'A'
          4        INIT_FCALL                                                   'json_encode'
          5        SEND_VAL                                                     <array>
          6        DO_ICALL                                             $11     
          7        ADD_ARRAY_ELEMENT                                    ~10     $11
          8        ADD_ARRAY_ELEMENT                                    ~10     'B'
          9        ASSIGN                                                       !3, ~10
    9    10        ECHO                                                         '%0ABEFORE%3A%0A'
   10    11        INIT_FCALL                                                   'var_export'
         12        SEND_VAR                                                     !3
         13        DO_ICALL                                                     
   11    14        ECHO                                                         '%0A'
   13    15        INIT_FCALL                                                   'fopen'
         16        ASSIGN                                               ~14     !5, 'php%3A%2F%2Ftemp'
         17        SEND_VAL                                                     ~14
         18        SEND_VAL                                                     'rb%2B'
         19        DO_ICALL                                             $15     
         20        ASSIGN                                                       !4, $15
   15    21        INIT_FCALL                                                   'fputcsv'
         22        SEND_VAR                                                     !4
         23        SEND_VAR                                                     !3
         24        SEND_VAR                                                     !0
         25        SEND_VAR                                                     !1
         26        SEND_VAR                                                     !2
         27        DO_ICALL                                                     
   17    28        INIT_FCALL                                                   'rewind'
         29        SEND_VAR                                                     !4
         30        DO_ICALL                                                     
   19    31        INIT_FCALL                                                   'fgetcsv'
         32        SEND_VAR                                                     !4
         33        SEND_VAL                                                     500
         34        SEND_VAR                                                     !0
         35        SEND_VAR                                                     !1
         36        SEND_VAR                                                     !2
         37        DO_ICALL                                             $19     
         38        ASSIGN                                                       !6, $19
   21    39        ECHO                                                         '%0AAFTER%3A%0A'
   22    40        INIT_FCALL                                                   'var_export'
         41        SEND_VAR                                                     !6
         42        DO_ICALL                                                     
   23    43        ECHO                                                         '%0A%0A'
   25    44        INIT_FCALL                                                   'fclose'
         45        SEND_VAR                                                     !4
         46        DO_ICALL                                                     
         47      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.24 ms | 2137 KiB | 20 Q