3v4l.org

run code in 500+ PHP versions simultaneously
<?php $file = new SplTempFileObject(); // write to file for ($i = 0; $i < 5; $i++) { $file->fwrite("line {$i}" . PHP_EOL); } $file->rewind(); $file->next(); $file->next(); // read third line var_dump($file->fgets()); // where am I? echo $file->key(), ': ', $file->current();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
Branch analysis from position: 5
filename:       /in/W6GGD
function name:  (null)
number of ops:  33
compiled vars:  !0 = $file, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $2      'SplTempFileObject'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
    6     3        ASSIGN                                                       !1, 0
          4      > JMP                                                          ->12
    7     5    >   INIT_METHOD_CALL                                             !0, 'fwrite'
          6        NOP                                                          
          7        FAST_CONCAT                                          ~6      'line+', !1
          8        CONCAT                                               ~7      ~6, '%0A'
          9        SEND_VAL_EX                                                  ~7
         10        DO_FCALL                                          0          
    6    11        PRE_INC                                                      !1
         12    >   IS_SMALLER                                                   !1, 5
         13      > JMPNZ                                                        ~10, ->5
   10    14    >   INIT_METHOD_CALL                                             !0, 'rewind'
         15        DO_FCALL                                          0          
   12    16        INIT_METHOD_CALL                                             !0, 'next'
         17        DO_FCALL                                          0          
   13    18        INIT_METHOD_CALL                                             !0, 'next'
         19        DO_FCALL                                          0          
   15    20        INIT_FCALL                                                   'var_dump'
         21        INIT_METHOD_CALL                                             !0, 'fgets'
         22        DO_FCALL                                          0  $14     
         23        SEND_VAR                                                     $14
         24        DO_ICALL                                                     
   18    25        INIT_METHOD_CALL                                             !0, 'key'
         26        DO_FCALL                                          0  $16     
         27        ECHO                                                         $16
         28        ECHO                                                         '%3A+'
         29        INIT_METHOD_CALL                                             !0, 'current'
         30        DO_FCALL                                          0  $17     
         31        ECHO                                                         $17
         32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.33 ms | 1856 KiB | 14 Q