@ 2020-04-12T09:00:28Z <?php
/**
* noop filter class for demonstration
*/
class stream_sigsegv extends php_user_filter
{
/**
* @var resource
*/
private $filterHandle;
/**
* @param resource $filterHandle
*/
public function __construct($filterHandle)
{
$this->filterHandle = $filterHandle;
}
/**
* @return int
*/
public function filter($in, $out, &$consumed, $closing)
{
while ($bucket = stream_bucket_make_writeable($in)) {
$consumed += $bucket->datalen;
stream_bucket_append($out, $bucket);
}
return PSFS_PASS_ON;
}
public function __destruct()
{
if (is_resource($this->filterHandle)) {
stream_filter_remove($this->filterHandle);
}
}
}
$filterName = $filterClass = 'stream_sigsegv';
stream_filter_register($filterName, $filterClass);
$handle = fopen('php://temp', 'rb');
$filterHandle = stream_filter_append($handle, $filterName, STREAM_FILTER_READ);
assert(false !== $filterHandle, 'append filter success');
$foo = new stream_sigsegv($filterHandle);
fclose($handle);
# Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.1.0 - 8.1.33 , 8.2.0 - 8.2.29 , 8.3.0 - 8.3.25 , 8.4.1 - 8.4.12 Deprecated: Return type of stream_sigsegv::filter($in, $out, &$consumed, $closing) should either be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/QR6ev on line 24
Output for 7.2.30 - 7.2.34 , 7.3.18 - 7.3.33 , 7.4.6 - 7.4.33 , 8.0.0 - 8.0.30 Output for 7.2.0 - 7.2.29 , 7.3.0 - 7.3.17 , 7.4.0 - 7.4.5 Process exited with code 139 . preferences:dark mode live preview ace vim emacs key bindings
150.72 ms | 407 KiB | 5 Q