3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = new SplFileObject('php://memory', "w+"); $file->fwrite('non-blank line1' . PHP_EOL); $file->fwrite('non-blank line2' . PHP_EOL); $file->rewind(); $file->setFlags( SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE ); foreach ($file as $line) { print "Currently on key " . $file->key() . ": " . PHP_EOL; var_dump($line); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/Ad364
function name:  (null)
number of ops:  30
compiled vars:  !0 = $file, !1 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'SplFileObject'
          1        SEND_VAL_EX                                              'php%3A%2F%2Fmemory'
          2        SEND_VAL_EX                                              'w%2B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    4     5        INIT_METHOD_CALL                                         !0, 'fwrite'
          6        SEND_VAL_EX                                              'non-blank+line1%0A'
          7        DO_FCALL                                      0          
    5     8        INIT_METHOD_CALL                                         !0, 'fwrite'
          9        SEND_VAL_EX                                              'non-blank+line2%0A'
         10        DO_FCALL                                      0          
    6    11        INIT_METHOD_CALL                                         !0, 'rewind'
         12        DO_FCALL                                      0          
    7    13        INIT_METHOD_CALL                                         !0, 'setFlags'
         14        SEND_VAL_EX                                              5
         15        DO_FCALL                                      0          
    9    16      > FE_RESET_R                                       $9      !0, ->28
         17    > > FE_FETCH_R                                               $9, !1, ->28
   10    18    >   INIT_METHOD_CALL                                         !0, 'key'
         19        DO_FCALL                                      0  $10     
         20        CONCAT                                           ~11     'Currently+on+key+', $10
         21        CONCAT                                           ~12     ~11, '%3A+'
         22        CONCAT                                           ~13     ~12, '%0A'
         23        ECHO                                                     ~13
   11    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
    9    27      > JMP                                                      ->17
         28    >   FE_FREE                                                  $9
   12    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.74 ms | 1396 KiB | 15 Q