3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = new SplFileObject('php://memory', 'r+'); assert('$f instanceof Iterator'); $f->fwrite("line 1"); $f->rewind(); assert('$f->valid() === true'); assert('$f->eof() === false'); assert('$f->current() === "line 1"'); assert('$f->valid() === true'); // fails assert('$f->eof() === true');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P9Y9A
function name:  (null)
number of ops:  41
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'SplFileObject'
          1        SEND_VAL_EX                                              'php%3A%2F%2Fmemory'
          2        SEND_VAL_EX                                              'r%2B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
    4     5        ASSERT_CHECK                                             
          6        INIT_FCALL                                               'assert'
          7        SEND_VAL                                                 '%24f+instanceof+Iterator'
          8        SEND_VAL                                                 'assert%28%27%24f+instanceof+Iterator%27%29'
          9        DO_ICALL                                                 
    5    10        INIT_METHOD_CALL                                         !0, 'fwrite'
         11        SEND_VAL_EX                                              'line+1'
         12        DO_FCALL                                      0          
    6    13        INIT_METHOD_CALL                                         !0, 'rewind'
         14        DO_FCALL                                      0          
    7    15        ASSERT_CHECK                                             
         16        INIT_FCALL                                               'assert'
         17        SEND_VAL                                                 '%24f-%3Evalid%28%29+%3D%3D%3D+true'
         18        SEND_VAL                                                 'assert%28%27%24f-%3Evalid%28%29+%3D%3D%3D+true%27%29'
         19        DO_ICALL                                                 
    8    20        ASSERT_CHECK                                             
         21        INIT_FCALL                                               'assert'
         22        SEND_VAL                                                 '%24f-%3Eeof%28%29+%3D%3D%3D+false'
         23        SEND_VAL                                                 'assert%28%27%24f-%3Eeof%28%29+%3D%3D%3D+false%27%29'
         24        DO_ICALL                                                 
    9    25        ASSERT_CHECK                                             
         26        INIT_FCALL                                               'assert'
         27        SEND_VAL                                                 '%24f-%3Ecurrent%28%29+%3D%3D%3D+%22line+1%22'
         28        SEND_VAL                                                 'assert%28%27%24f-%3Ecurrent%28%29+%3D%3D%3D+%22line+1%22%27%29'
         29        DO_ICALL                                                 
   10    30        ASSERT_CHECK                                             
         31        INIT_FCALL                                               'assert'
         32        SEND_VAL                                                 '%24f-%3Evalid%28%29+%3D%3D%3D+true'
         33        SEND_VAL                                                 'assert%28%27%24f-%3Evalid%28%29+%3D%3D%3D+true%27%29'
         34        DO_ICALL                                                 
   11    35        ASSERT_CHECK                                             
         36        INIT_FCALL                                               'assert'
         37        SEND_VAL                                                 '%24f-%3Eeof%28%29+%3D%3D%3D+true'
         38        SEND_VAL                                                 'assert%28%27%24f-%3Eeof%28%29+%3D%3D%3D+true%27%29'
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.15 ms | 1400 KiB | 15 Q