3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class VariableStream { var $position; var $varname; function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); $this->varname = $url["host"]; $this->position = 0; return true; } function stream_read($count) { $ret = substr(gzinflate($GLOBALS[$this->varname]), $this->position, $count); $this->position += strlen($ret); return $ret; } function stream_eof() { return true; } function stream_stat() { return array(); //return stat(__FILE__); } } stream_wrapper_register("var", "VariableStream"); $myvar = gzdeflate("<?php echo 123;"); include("var://myvar");
Output for 4.3.2 - 4.4.9, 5.1.3 - 7.1.0
123
Output for 5.0.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/CZVsS on line 4 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/CZVsS on line 5 123
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: stream_wrapper_register() in /in/CZVsS on line 34