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->seek(50); echo json_encode(array( array('triggerNext' => $file->next(), 'line' => $file->key(), 'contents' => trim($file->current())), array('triggerNext' => $file->next(), 'line' => $file->key(), 'contents' => trim($file->current())), array('triggerNext' => $file->next(), 'line' => $file->key(), 'contents' => trim($file->current())), ), JSON_PRETTY_PRINT);
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/s4ZKA
function name:  (null)
number of ops:  56
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, 'seek'
         15        SEND_VAL_EX                                                  50
         16        DO_FCALL                                          0          
   11    17        INIT_FCALL                                                   'json_encode'
   12    18        INIT_METHOD_CALL                                             !0, 'next'
         19        DO_FCALL                                          0  $13     
         20        INIT_ARRAY                                           ~14     $13, 'triggerNext'
         21        INIT_METHOD_CALL                                             !0, 'key'
         22        DO_FCALL                                          0  $15     
         23        ADD_ARRAY_ELEMENT                                    ~14     $15, 'line'
         24        INIT_METHOD_CALL                                             !0, 'current'
         25        DO_FCALL                                          0  $16     
         26        FRAMELESS_ICALL_1                trim                ~17     $16
         27        ADD_ARRAY_ELEMENT                                    ~14     ~17, 'contents'
         28        INIT_ARRAY                                           ~18     ~14
   13    29        INIT_METHOD_CALL                                             !0, 'next'
         30        DO_FCALL                                          0  $19     
         31        INIT_ARRAY                                           ~20     $19, 'triggerNext'
         32        INIT_METHOD_CALL                                             !0, 'key'
         33        DO_FCALL                                          0  $21     
         34        ADD_ARRAY_ELEMENT                                    ~20     $21, 'line'
         35        INIT_METHOD_CALL                                             !0, 'current'
         36        DO_FCALL                                          0  $22     
         37        FRAMELESS_ICALL_1                trim                ~23     $22
         38        ADD_ARRAY_ELEMENT                                    ~20     ~23, 'contents'
         39        ADD_ARRAY_ELEMENT                                    ~18     ~20
   14    40        INIT_METHOD_CALL                                             !0, 'next'
         41        DO_FCALL                                          0  $24     
         42        INIT_ARRAY                                           ~25     $24, 'triggerNext'
         43        INIT_METHOD_CALL                                             !0, 'key'
         44        DO_FCALL                                          0  $26     
         45        ADD_ARRAY_ELEMENT                                    ~25     $26, 'line'
         46        INIT_METHOD_CALL                                             !0, 'current'
         47        DO_FCALL                                          0  $27     
         48        FRAMELESS_ICALL_1                trim                ~28     $27
         49        ADD_ARRAY_ELEMENT                                    ~25     ~28, 'contents'
         50        ADD_ARRAY_ELEMENT                                    ~18     ~25
         51        SEND_VAL                                                     ~18
   15    52        SEND_VAL                                                     128
   11    53        DO_ICALL                                             $29     
   15    54        ECHO                                                         $29
         55      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.51 ms | 2852 KiB | 9 Q