3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=66182 class before_body_foo_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { // this exit; causes a segfault exit; } } stream_filter_register('before_body_foo', 'before_body_foo_filter'); $fp = fopen('php://output', 'w'); stream_filter_append($fp, 'before_body_foo', STREAM_FILTER_WRITE, 'YES'); fwrite($fp, 'hello');

preferences:
44.87 ms | 402 KiB | 5 Q