3v4l.org

run code in 300+ 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:  104
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_FCALL                                               'trim'
         21        INIT_METHOD_CALL                                         !0, 'current'
         22        DO_FCALL                                      0  $15     
         23        SEND_VAR                                                 $15
         24        DO_ICALL                                         $16     
         25        ADD_ARRAY_ELEMENT                                ~14     $16, 'contents'
         26        INIT_METHOD_CALL                                         !0, 'next'
         27        DO_FCALL                                      0  $17     
         28        ADD_ARRAY_ELEMENT                                ~14     $17, 'triggerNext'
         29        INIT_ARRAY                                       ~18     ~14
   13    30        INIT_METHOD_CALL                                         !0, 'key'
         31        DO_FCALL                                      0  $19     
         32        INIT_ARRAY                                       ~20     $19, 'line'
         33        INIT_FCALL                                               'trim'
         34        INIT_METHOD_CALL                                         !0, 'current'
         35        DO_FCALL                                      0  $21     
         36        SEND_VAR                                                 $21
         37        DO_ICALL                                         $22     
         38        ADD_ARRAY_ELEMENT                                ~20     $22, 'contents'
         39        INIT_METHOD_CALL                                         !0, 'next'
         40        DO_FCALL                                      0  $23     
         41        ADD_ARRAY_ELEMENT                                ~20     $23, 'triggerNext'
         42        ADD_ARRAY_ELEMENT                                ~18     ~20
   14    43        INIT_METHOD_CALL                                         !0, 'key'
         44        DO_FCALL                                      0  $24     
         45        INIT_ARRAY                                       ~25     $24, 'line'
         46        INIT_FCALL                                               'trim'
         47        INIT_METHOD_CALL                                         !0, 'current'
         48        DO_FCALL                                      0  $26     
         49        SEND_VAR                                                 $26
         50        DO_ICALL                                         $27     
         51        ADD_ARRAY_ELEMENT                                ~25     $27, 'contents'
         52        INIT_METHOD_CALL                                         !0, 'next'
         53        DO_FCALL                                      0  $28     
         54        ADD_ARRAY_ELEMENT                                ~25     $28, 'triggerNext'
         55        ADD_ARRAY_ELEMENT                                ~18     ~25
         56        SEND_VAL                                                 ~18
         57        DO_ICALL                                                 
   17    58        INIT_METHOD_CALL                                         !0, 'seek'
         59        SEND_VAL_EX                                              50
         60        DO_FCALL                                      0          
   19    61        INIT_FCALL                                               'print_r'
   20    62        INIT_METHOD_CALL                                         !0, 'key'
         63        DO_FCALL                                      0  $31     
         64        INIT_ARRAY                                       ~32     $31, 'line'
         65        INIT_FCALL                                               'trim'
         66        INIT_METHOD_CALL                                         !0, 'current'
         67        DO_FCALL                                      0  $33     
         68        SEND_VAR                                                 $33
         69        DO_ICALL                                         $34     
         70        ADD_ARRAY_ELEMENT                                ~32     $34, 'contents'
         71        INIT_METHOD_CALL                                         !0, 'next'
         72        DO_FCALL                                      0  $35     
         73        ADD_ARRAY_ELEMENT                                ~32     $35, 'triggerNext'
         74        INIT_ARRAY                                       ~36     ~32
   21    75        INIT_METHOD_CALL                                         !0, 'key'
         76        DO_FCALL                                      0  $37     
         77        INIT_ARRAY                                       ~38     $37, 'line'
         78        INIT_FCALL                                               'trim'
         79        INIT_METHOD_CALL                                         !0, 'current'
         80        DO_FCALL                                      0  $39     
         81        SEND_VAR                                                 $39
         82        DO_ICALL                                         $40     
         83        ADD_ARRAY_ELEMENT                                ~38     $40, 'contents'
         84        INIT_METHOD_CALL                                         !0, 'next'
         85        DO_FCALL                                      0  $41     
         86        ADD_ARRAY_ELEMENT                                ~38     $41, 'triggerNext'
         87        ADD_ARRAY_ELEMENT                                ~36     ~38
   22    88        INIT_METHOD_CALL                                         !0, 'key'
         89        DO_FCALL                                      0  $42     
         90        INIT_ARRAY                                       ~43     $42, 'line'
         91        INIT_FCALL                                               'trim'
         92        INIT_METHOD_CALL                                         !0, 'current'
         93        DO_FCALL                                      0  $44     
         94        SEND_VAR                                                 $44
         95        DO_ICALL                                         $45     
         96        ADD_ARRAY_ELEMENT                                ~43     $45, 'contents'
         97        INIT_METHOD_CALL                                         !0, 'next'
         98        DO_FCALL                                      0  $46     
         99        ADD_ARRAY_ELEMENT                                ~43     $46, 'triggerNext'
        100        ADD_ARRAY_ELEMENT                                ~36     ~43
        101        SEND_VAL                                                 ~36
        102        DO_ICALL                                                 
   23   103      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.55 ms | 1409 KiB | 17 Q