3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stream = fopen('php://temp','r+'); var_dump(fstat($stream)['size']); //int(0) $r = fputs($stream,'1234'); var_dump(fstat($stream)['size']); //int(4) rewind($stream); $str = fgets($stream,'1234'); var_dump($str, fstat($stream)['size']); //string(4) "1234" int(4)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hsodg
function name:  (null)
number of ops:  41
compiled vars:  !0 = $stream, !1 = $r, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Ftemp'
          2        SEND_VAL                                                 'r%2B'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'fstat'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        FETCH_DIM_R                                      ~6      $5, 'size'
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
    6    12        INIT_FCALL                                               'fputs'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 '1234'
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !1, $8
    7    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'fstat'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $10     
         21        FETCH_DIM_R                                      ~11     $10, 'size'
         22        SEND_VAL                                                 ~11
         23        DO_ICALL                                                 
    9    24        INIT_FCALL                                               'rewind'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
   10    27        INIT_FCALL                                               'fgets'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 '1234'
         30        DO_ICALL                                         $14     
         31        ASSIGN                                                   !2, $14
   11    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !2
         34        INIT_FCALL                                               'fstat'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $16     
         37        FETCH_DIM_R                                      ~17     $16, 'size'
         38        SEND_VAL                                                 ~17
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
201.47 ms | 1016 KiB | 19 Q