3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2); $file = new splfileobject('/tmp/stdfile.txt', 'w+'); $file->fputcsv($a); var_dump(file_get_contents('/tmp/stdfile.txt'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8jRYN
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        NEW                                              $3      'splfileobject'
          2        SEND_VAL_EX                                              '%2Ftmp%2Fstdfile.txt'
          3        SEND_VAL_EX                                              'w%2B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $3
    6     6        INIT_METHOD_CALL                                         !1, 'fputcsv'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
    8     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'file_get_contents'
         11        SEND_VAL                                                 '%2Ftmp%2Fstdfile.txt'
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.04 ms | 1385 KiB | 17 Q