3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $fileName = tempnam(sys_get_temp_dir(), 'test_'); $fileResource = fopen($fileName, 'wb'); fputcsv($fileResource, [false, 1, 1.0, 'string', [0], new class {function __toString(){ return 'foo';}}]); fclose($fileResource); echo file_get_contents($fileName);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ahdmn
function name:  (null)
number of ops:  33
compiled vars:  !0 = $fileName, !1 = $fileResource
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'tempnam'
          1        INIT_FCALL                                               'sys_get_temp_dir'
          2        DO_ICALL                                         $2      
          3        SEND_VAR                                                 $2
          4        SEND_VAL                                                 'test_'
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    7     7        INIT_FCALL                                               'fopen'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'wb'
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
    8    12        INIT_FCALL                                               'fputcsv'
         13        SEND_VAR                                                 !1
         14        INIT_ARRAY                                       ~7      <false>
         15        ADD_ARRAY_ELEMENT                                ~7      1
         16        ADD_ARRAY_ELEMENT                                ~7      1
         17        ADD_ARRAY_ELEMENT                                ~7      'string'
         18        ADD_ARRAY_ELEMENT                                ~7      <array>
         19        DECLARE_ANON_CLASS                               <resource>  
         20        NEW                                              $9      $8
         21        DO_FCALL                                      0          
         22        ADD_ARRAY_ELEMENT                                ~7      $9
         23        SEND_VAL                                                 ~7
         24        DO_ICALL                                                 
    9    25        INIT_FCALL                                               'fclose'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
   10    28        INIT_FCALL                                               'file_get_contents'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $13     
         31        ECHO                                                     $13
         32      > RETURN                                                   1

Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ahdmn
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'foo'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.5 ms | 1006 KiB | 19 Q