3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fp = fopen('/tmp/foo', 'wb'); var_dump(filesize('/tmp/foo')); fwrite($fp, '1'); fclose($fp); var_dump(filesize('/tmp/foo')); $file = new SplFileObject('/tmp/bar', 'wb'); var_dump(filesize('/tmp/bar')); $file->fwrite('1'); $file = null; var_dump(filesize('/tmp/bar'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n4lTX
function name:  (null)
number of ops:  46
compiled vars:  !0 = $fp, !1 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 '%2Ftmp%2Ffoo'
          2        SEND_VAL                                                 'wb'
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    4     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'filesize'
          7        SEND_VAL                                                 '%2Ftmp%2Ffoo'
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
    5    11        INIT_FCALL                                               'fwrite'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 '1'
         14        DO_ICALL                                                 
    6    15        INIT_FCALL                                               'fclose'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
    7    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'filesize'
         20        SEND_VAL                                                 '%2Ftmp%2Ffoo'
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                                 
    9    24        NEW                                              $10     'SplFileObject'
         25        SEND_VAL_EX                                              '%2Ftmp%2Fbar'
         26        SEND_VAL_EX                                              'wb'
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !1, $10
   10    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'filesize'
         31        SEND_VAL                                                 '%2Ftmp%2Fbar'
         32        DO_ICALL                                         $13     
         33        SEND_VAR                                                 $13
         34        DO_ICALL                                                 
   11    35        INIT_METHOD_CALL                                         !1, 'fwrite'
         36        SEND_VAL_EX                                              '1'
         37        DO_FCALL                                      0          
   12    38        ASSIGN                                                   !1, null
   13    39        INIT_FCALL                                               'var_dump'
         40        INIT_FCALL                                               'filesize'
         41        SEND_VAL                                                 '%2Ftmp%2Fbar'
         42        DO_ICALL                                         $17     
         43        SEND_VAR                                                 $17
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.51 ms | 1405 KiB | 23 Q