3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $file = new SplTempFileObject(); // write to file for ($i = 0; $i < 5; $i++) { $file->fwrite("line {$i}" . PHP_EOL); } $file->rewind(); // read first line $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/R8sMu
function name:  (null)
number of ops:  26
compiled vars:  !0 = $file, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $2      'SplTempFileObject'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    8     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->12
    9     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          
    8    11        PRE_INC                                                  !1
         12    >   IS_SMALLER                                               !1, 5
         13      > JMPNZ                                                    ~10, ->5
   12    14    >   INIT_METHOD_CALL                                         !0, 'rewind'
         15        DO_FCALL                                      0          
   15    16        INIT_METHOD_CALL                                         !0, 'fgets'
         17        DO_FCALL                                      0          
   18    18        INIT_METHOD_CALL                                         !0, 'key'
         19        DO_FCALL                                      0  $13     
         20        ECHO                                                     $13
         21        ECHO                                                     '%3A+'
         22        INIT_METHOD_CALL                                         !0, 'current'
         23        DO_FCALL                                      0  $14     
         24        ECHO                                                     $14
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.19 ms | 995 KiB | 13 Q