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','w'); $filter = stream_filter_append($fd, 'user_filter'); fwrite($fd, "foo");
Output for 7.0.0 - 7.1.0
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Stack overflow in /in/jdmkG on line 6
Process exited with code 255.
Output for 5.4.0 - 5.6.22

Process exited with code 139.
Output for 5.2.3 - 5.3.29
Warning: fclose(): 5 is not a valid stream resource in /in/jdmkG on line 6
Output for 5.1.4 - 5.2.2
Warning: fclose(): 2 is not a valid stream resource in /in/jdmkG on line 6
Output for 5.0.0 - 5.1.3
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/jdmkG on line 10 Warning: stream_filter_append() expects parameter 1 to be resource, boolean given in /in/jdmkG on line 11 Warning: fwrite(): supplied argument is not a valid stream resource in /in/jdmkG on line 12
Output for 4.3.2 - 4.4.9
Fatal error: Class user_filter: Cannot inherit from undefined class php_user_filter in /in/jdmkG 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/jdmkG on line 2