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/3C4eO
function name:  (null)
number of ops:  48
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        INIT_METHOD_CALL                                         !0, 'valid'
         18        DO_FCALL                                      0  $7      
         19        TYPE_CHECK                                    8  ~8      $7
         20        SEND_VAL                                                 ~8
         21        SEND_VAL                                                 'assert%28%24f-%3Evalid%28%29+%3D%3D%3D+true%29'
         22        DO_ICALL                                                 
    8    23        ASSERT_CHECK                                             
         24        INIT_FCALL                                               'assert'
         25        INIT_METHOD_CALL                                         !0, 'eof'
         26        DO_FCALL                                      0  $10     
         27        TYPE_CHECK                                    4  ~11     $10
         28        SEND_VAL                                                 ~11
         29        SEND_VAL                                                 'assert%28%24f-%3Eeof%28%29+%3D%3D%3D+false%29'
         30        DO_ICALL                                                 
    9    31        ASSERT_CHECK                                             
         32        INIT_FCALL                                               'assert'
         33        INIT_METHOD_CALL                                         !0, 'current'
         34        DO_FCALL                                      0  $13     
         35        IS_IDENTICAL                                     ~14     $13, 'line+1'
         36        SEND_VAL                                                 ~14
         37        SEND_VAL                                                 'assert%28%24f-%3Ecurrent%28%29+%3D%3D%3D+%27line+1%27%29'
         38        DO_ICALL                                                 
   11    39        ASSERT_CHECK                                             
         40        INIT_FCALL                                               'assert'
         41        INIT_METHOD_CALL                                         !0, 'eof'
         42        DO_FCALL                                      0  $16     
         43        TYPE_CHECK                                    8  ~17     $16
         44        SEND_VAL                                                 ~17
         45        SEND_VAL                                                 'assert%28%24f-%3Eeof%28%29+%3D%3D%3D+true%29'
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.47 ms | 1404 KiB | 15 Q