3v4l.org

run code in 300+ PHP versions simultaneously
<?php $existed = in_array("var", stream_get_wrappers()); if ($existed) { stream_wrapper_unregister("var"); } stream_wrapper_register("var", "VariableStream"); $myvar = ""; $fp = fopen("var://myvar", "r+"); fwrite($fp, "line1\n"); fwrite($fp, "line2\n"); fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { echo fgets($fp); } fclose($fp); var_dump($myvar); if ($existed) { stream_wrapper_restore("var"); } ?>

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 37
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 37
Branch analysis from position: 46
Branch analysis from position: 37
Branch analysis from position: 11
filename:       /in/eJcLq
function name:  (null)
number of ops:  57
compiled vars:  !0 = $existed, !1 = $myvar, !2 = $fp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'in_array'
          1        SEND_VAL                                                 'var'
          2        INIT_FCALL                                               'stream_get_wrappers'
          3        DO_ICALL                                         $3      
          4        SEND_VAR                                                 $3
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
    3     7      > JMPZ                                                     !0, ->11
    4     8    >   INIT_FCALL                                               'stream_wrapper_unregister'
          9        SEND_VAL                                                 'var'
         10        DO_ICALL                                                 
    6    11    >   INIT_FCALL                                               'stream_wrapper_register'
         12        SEND_VAL                                                 'var'
         13        SEND_VAL                                                 'VariableStream'
         14        DO_ICALL                                                 
    7    15        ASSIGN                                                   !1, ''
    9    16        INIT_FCALL                                               'fopen'
         17        SEND_VAL                                                 'var%3A%2F%2Fmyvar'
         18        SEND_VAL                                                 'r%2B'
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !2, $9
   11    21        INIT_FCALL                                               'fwrite'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 'line1%0A'
         24        DO_ICALL                                                 
   12    25        INIT_FCALL                                               'fwrite'
         26        SEND_VAR                                                 !2
         27        SEND_VAL                                                 'line2%0A'
         28        DO_ICALL                                                 
   13    29        INIT_FCALL                                               'fwrite'
         30        SEND_VAR                                                 !2
         31        SEND_VAL                                                 'line3%0A'
         32        DO_ICALL                                                 
   15    33        INIT_FCALL                                               'rewind'
         34        SEND_VAR                                                 !2
         35        DO_ICALL                                                 
   16    36      > JMP                                                      ->41
   17    37    >   INIT_FCALL                                               'fgets'
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                         $15     
         40        ECHO                                                     $15
   16    41    >   INIT_FCALL                                               'feof'
         42        SEND_VAR                                                 !2
         43        DO_ICALL                                         $16     
         44        BOOL_NOT                                         ~17     $16
         45      > JMPNZ                                                    ~17, ->37
   19    46    >   INIT_FCALL                                               'fclose'
         47        SEND_VAR                                                 !2
         48        DO_ICALL                                                 
   20    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !1
         51        DO_ICALL                                                 
   22    52      > JMPZ                                                     !0, ->56
   23    53    >   INIT_FCALL                                               'stream_wrapper_restore'
         54        SEND_VAL                                                 'var'
         55        DO_ICALL                                                 
   26    56    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.81 ms | 1400 KiB | 37 Q