Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/bootstrap-aot/stdlib_stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
declare(strict_types=1);

/**
* Bootstrap AOT: fopen/fread/fclose stream I/O (issue #1117, self-host stdlib wave).
* Bootstrap AOT: fopen/fread/fclose stream I/O (issue #1117, #1152).
*
* Uses a repo-local fixture path (not sys_get_temp_dir()/getmypid()) so VM and AOT agree.
*/

$path = sys_get_temp_dir().'/phpc_stdlib_stream_'.(string) getmypid().'.txt';
$dir = 'test/bootstrap-aot/stdlib_stream_fixture';
@mkdir($dir);
$path = $dir.'/sample.txt';
file_put_contents($path, 'stream');
$h = fopen($path, 'r');
$data = fread($h, 6);
fclose($h);
@unlink($path);
@rmdir($dir);
echo is_string($data) && $data === 'stream' ? '1' : '0';
Loading