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'); echo fwrite($fd, "foo");
Output for 7.0.14 - 7.1.0
0
Output for 7.0.11
139786646384880
Output for 7.0.10
140459517604080
Output for 7.0.9
140666699337968
Output for 7.0.8
140163412218096
Output for 7.0.7
140654829457648
Output for 7.0.6
140412736327920
Output for 7.0.5
139665699328240
Output for 7.0.4
139859696374000
Output for 7.0.3
139694663094512
Output for 7.0.2
139750805950704
Output for 7.0.1
140333113757936
Output for 7.0.0
140413715697904
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/bjaEh on line 6 0
Output for 5.1.4 - 5.2.2
Warning: fclose(): 2 is not a valid stream resource in /in/bjaEh on line 6 0
Output for 5.0.0 - 5.1.3
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/bjaEh on line 10 Warning: stream_filter_append() expects parameter 1 to be resource, boolean given in /in/bjaEh on line 11 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bjaEh 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/bjaEh 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/bjaEh on line 2