3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new arrayObject(array(1, 2, 'd', "1,3")); $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/SfAdO
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'arrayObject'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    5     4        NEW                                              $5      'splfileobject'
          5        SEND_VAL_EX                                              '%2Ftmp%2Fstdfile.txt'
          6        SEND_VAL_EX                                              'w%2B'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $5
    6     9        INIT_METHOD_CALL                                         !1, 'fputcsv'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
    8    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'file_get_contents'
         14        SEND_VAL                                                 '%2Ftmp%2Fstdfile.txt'
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.02 ms | 1394 KiB | 17 Q