3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class user_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { while($bucket = stream_bucket_make_writeable($in)) { } fclose($this->stream); } } stream_filter_register('user_filter','user_filter'); $fd = fopen('php://memory','rw'); $filter = stream_filter_append($fd, 'user_filter'); echo fwrite($fd, "foo"); echo fread($fd, 3);
Output for 7.0.14 - 7.1.0
0 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.6
140099644117232 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.5
140165878468848 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.4
140365837717744 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.3
139819374432496 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.2
140208763130096 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.1
140455950242032 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 7.0.0
140450923368688 Warning: fread(): supplied resource is not a valid stream resource in /in/enSnq on line 13
Output for 5.4.0 - 5.6.28

Process exited with code 139.
Output for 5.2.3 - 5.3.29
Warning: fclose(): 5 is not a valid stream resource in /in/enSnq on line 6 0 Warning: fread(): 5 is not a valid stream resource in /in/enSnq on line 13
Output for 5.1.4 - 5.2.2
Warning: fclose(): 2 is not a valid stream resource in /in/enSnq on line 6 0 Warning: fread(): 2 is not a valid stream resource in /in/enSnq on line 13
Output for 5.0.0 - 5.1.3
Warning: fopen(php://memory): failed to open stream: Success in /in/enSnq on line 10 Warning: stream_filter_append() expects parameter 1 to be resource, boolean given in /in/enSnq on line 11 Warning: fwrite(): supplied argument is not a valid stream resource in /in/enSnq on line 12 Warning: fread(): supplied argument is not a valid stream resource in /in/enSnq on line 13
Output for 4.3.2 - 4.4.9
Fatal error: Class user_filter: Cannot inherit from undefined class php_user_filter in /in/enSnq on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class user_filter: Cannot inherit from undefined class php_user_filter in /in/enSnq on line 2