Skip to content

Fix GH-24256: fclose() returns false for wrappers without stream_flush() - #24259

Open
lazerg wants to merge 3 commits into
php:PHP-8.6from
lazerg:fix/gh-24256
Open

lazerg wants to merge 3 commits into
php:PHP-8.6from
lazerg:fix/gh-24256

Conversation

@lazerg

@lazerg lazerg commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Since c07cc85, fclose(), file_put_contents() and copy() return the result of the flush on close. php_userstreamop_flush() returns -1 when the wrapper has no stream_flush() method, so every write to such a wrapper now makes these functions return false. During close, a missing stream_flush() now counts as nothing to flush. An explicit fflush() still returns false for these wrappers, as SplFileObject_fflush_basic_001.phpt expects.

Fixes #24256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant