@ 2014-10-24T16:01:01Z <?php
class VariableStream {
var $position;
var $varname;
function stream_open($path, $mode, $options, &$opened_path) {
echo "openingt n";
$url = parse_url($path);
$this->varname = $url["host"];
$this->position = 0;
return true;
}
function stream_read($count) {
echo "reading\n";
$ret = substr($GLOBALS[$this->varname], $this->position, $count);
$this->position += strlen($ret);
return $ret;
}
function stream_eof() {
echo "eoffing\n";
return $this->position >= strlen($GLOBALS[$this->varname]);
}
function stream_stat() {
echo "stating\n";
$time = time();
return array(
0, // device number
0, // inode number
0, // inode protection mode
0, // number of links
0, // userid of owner
0, // groupid of owner
0, // device type, if inode device
strlen($GLOBALS[$this->varname]), // size in bytes
$time, // atime - time of last access
$time, // mtime - time of last modification
$time, // ctime - time of creation
-1, // block size of filesystem I/O
-1 // number of 512-byte blocks allocated
);
}
}
stream_wrapper_register("var", "VariableStream");
$myvar = "fooey";
$v = include 'var://myvar';
var_dump($v);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.4.0 - 7.4.1 openingt n
Warning: include(): VariableStream::stream_set_option is not implemented! in /in/YRUCv on line 52
stating
reading
eoffing
reading
eoffing
fooeyint(1)
Output for 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.26 , 7.3.0 - 7.3.13 openingt nstating
stating
reading
eoffing
reading
eoffing
fooeyint(1)
Output for 5.1.3 - 5.1.6 , 5.2.0 - 5.2.17 openingt nreading
eoffing
reading
eoffing
fooeyint(1)
Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.2 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/YRUCv on line 4
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/YRUCv on line 5
openingt nreading
eoffing
reading
eoffing
fooeyint(1)
Output for 4.3.9 - 4.3.11 , 4.4.0 - 4.4.9 openingt nreading
eoffing
reading
eoffing
reading
eoffing
fooeyint(1)
Output for 4.3.2 - 4.3.8 openingt nreading
eoffing
reading
eoffing
reading
eoffing
reading
eoffing
fooeyint(1)
Output for 4.3.0 - 4.3.1 Fatal error: Call to undefined function: stream_wrapper_register() in /in/YRUCv on line 48
preferences:dark mode live preview
213.45 ms | 401 KiB | 325 Q