3v4l.org

run code in 500+ PHP versions simultaneously
<?php $file = new SplTempFileObject(); for ($i = 0; $i < 100; $i++) { $file->fwrite("Foo $i\n"); } $file->rewind(); print_r(array( array('line' => $file->key(), 'contents' => trim($file->current()), 'triggerNext' => $file->next()), array('line' => $file->key(), 'contents' => trim($file->current()), 'triggerNext' => $file->next()), array('line' => $file->key(), 'contents' => trim($file->current()), 'triggerNext' => $file->next()), )); $file->seek(50); print_r(array( array('line' => $file->key(), 'contents' => trim($file->current()), 'triggerNext' => $file->next()), array('line' => $file->key(), 'contents' => trim($file->current()), 'triggerNext' => $file->next()), array('line' => $file->key(), 'contents' => trim($file->current()), 'triggerNext' => $file->next()), ));
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/WYrig
function name:  (null)
number of ops:  92
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
    5     3        ASSIGN                                                       !1, 0
          4      > JMP                                                          ->12
    6     5    >   INIT_METHOD_CALL                                             !0, 'fwrite'
          6        ROPE_INIT                                         3  ~7      'Foo+'
          7        ROPE_ADD                                          1  ~7      ~7, !1
          8        ROPE_END                                          2  ~6      ~7, '%0A'
          9        SEND_VAL_EX                                                  ~6
         10        DO_FCALL                                          0          
    5    11        PRE_INC                                                      !1
         12    >   IS_SMALLER                                                   !1, 100
         13      > JMPNZ                                                        ~11, ->5
    9    14    >   INIT_METHOD_CALL                                             !0, 'rewind'
         15        DO_FCALL                                          0          
   11    16        INIT_FCALL                                                   'print_r'
   12    17        INIT_METHOD_CALL                                             !0, 'key'
         18        DO_FCALL                                          0  $13     
         19        INIT_ARRAY                                           ~14     $13, 'line'
         20        INIT_METHOD_CALL                                             !0, 'current'
         21        DO_FCALL                                          0  $15     
         22        FRAMELESS_ICALL_1                trim                ~16     $15
         23        ADD_ARRAY_ELEMENT                                    ~14     ~16, 'contents'
         24        INIT_METHOD_CALL                                             !0, 'next'
         25        DO_FCALL                                          0  $17     
         26        ADD_ARRAY_ELEMENT                                    ~14     $17, 'triggerNext'
         27        INIT_ARRAY                                           ~18     ~14
   13    28        INIT_METHOD_CALL                                             !0, 'key'
         29        DO_FCALL                                          0  $19     
         30        INIT_ARRAY                                           ~20     $19, 'line'
         31        INIT_METHOD_CALL                                             !0, 'current'
         32        DO_FCALL                                          0  $21     
         33        FRAMELESS_ICALL_1                trim                ~22     $21
         34        ADD_ARRAY_ELEMENT                                    ~20     ~22, 'contents'
         35        INIT_METHOD_CALL                                             !0, 'next'
         36        DO_FCALL                                          0  $23     
         37        ADD_ARRAY_ELEMENT                                    ~20     $23, 'triggerNext'
         38        ADD_ARRAY_ELEMENT                                    ~18     ~20
   14    39        INIT_METHOD_CALL                                             !0, 'key'
         40        DO_FCALL                                          0  $24     
         41        INIT_ARRAY                                           ~25     $24, 'line'
         42        INIT_METHOD_CALL                                             !0, 'current'
         43        DO_FCALL                                          0  $26     
         44        FRAMELESS_ICALL_1                trim                ~27     $26
         45        ADD_ARRAY_ELEMENT                                    ~25     ~27, 'contents'
         46        INIT_METHOD_CALL                                             !0, 'next'
         47        DO_FCALL                                          0  $28     
         48        ADD_ARRAY_ELEMENT                                    ~25     $28, 'triggerNext'
         49        ADD_ARRAY_ELEMENT                                    ~18     ~25
         50        SEND_VAL                                                     ~18
   11    51        DO_ICALL                                                     
   17    52        INIT_METHOD_CALL                                             !0, 'seek'
         53        SEND_VAL_EX                                                  50
         54        DO_FCALL                                          0          
   19    55        INIT_FCALL                                                   'print_r'
   20    56        INIT_METHOD_CALL                                             !0, 'key'
         57        DO_FCALL                                          0  $31     
         58        INIT_ARRAY                                           ~32     $31, 'line'
         59        INIT_METHOD_CALL                                             !0, 'current'
         60        DO_FCALL                                          0  $33     
         61        FRAMELESS_ICALL_1                trim                ~34     $33
         62        ADD_ARRAY_ELEMENT                                    ~32     ~34, 'contents'
         63        INIT_METHOD_CALL                                             !0, 'next'
         64        DO_FCALL                                          0  $35     
         65        ADD_ARRAY_ELEMENT                                    ~32     $35, 'triggerNext'
         66        INIT_ARRAY                                           ~36     ~32
   21    67        INIT_METHOD_CALL                                             !0, 'key'
         68        DO_FCALL                                          0  $37     
         69        INIT_ARRAY                                           ~38     $37, 'line'
         70        INIT_METHOD_CALL                                             !0, 'current'
         71        DO_FCALL                                          0  $39     
         72        FRAMELESS_ICALL_1                trim                ~40     $39
         73        ADD_ARRAY_ELEMENT                                    ~38     ~40, 'contents'
         74        INIT_METHOD_CALL                                             !0, 'next'
         75        DO_FCALL                                          0  $41     
         76        ADD_ARRAY_ELEMENT                                    ~38     $41, 'triggerNext'
         77        ADD_ARRAY_ELEMENT                                    ~36     ~38
   22    78        INIT_METHOD_CALL                                             !0, 'key'
         79        DO_FCALL                                          0  $42     
         80        INIT_ARRAY                                           ~43     $42, 'line'
         81        INIT_METHOD_CALL                                             !0, 'current'
         82        DO_FCALL                                          0  $44     
         83        FRAMELESS_ICALL_1                trim                ~45     $44
         84        ADD_ARRAY_ELEMENT                                    ~43     ~45, 'contents'
         85        INIT_METHOD_CALL                                             !0, 'next'
         86        DO_FCALL                                          0  $46     
         87        ADD_ARRAY_ELEMENT                                    ~43     $46, 'triggerNext'
         88        ADD_ARRAY_ELEMENT                                    ~36     ~43
         89        SEND_VAL                                                     ~36
   19    90        DO_ICALL                                                     
   23    91      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.95 ms | 3153 KiB | 9 Q