Closed
Description
Description
The following code:
<?php
class TestStream { //data, empty data, empty data + eof
public $context;
private $s = 0;
function stream_open($path, $mode, $options, &$opened_path) {
return true;
}
function stream_read($count) {
echo "Read done\n";
if ($this->s++ == 0)
return "a\nbb\ncc";
return "";
}
function stream_eof() {
return $this->s >= 2;
}
}
stream_wrapper_register("test", "TestStream");
$f = fopen("test://", "r");
file_put_contents(1, $f, 1, $f);
?>
Resulted in this output:
/php-src/main/streams/streams.c:2214: _php_stream_open_wrapper_ex: Assertion `resolved_path == ((void *)0)' failed.
Aborted (core dumped)
PHP Version
PHP 8.4.0-dev
Operating System
ubuntu 22.04