-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #68948 related to a BC break introduced by #68532 fix.
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--TEST-- | ||
Bug #68948: feof() on temporary streams broken | ||
--FILE-- | ||
<?php | ||
|
||
$testString = '0123456789'; | ||
|
||
$stream = fopen("php://memory", "r+"); | ||
fwrite($stream, $testString); | ||
rewind($stream); | ||
|
||
var_dump(fread($stream, 10)); | ||
var_dump(ftell($stream)); | ||
var_dump(feof($stream)); | ||
|
||
rewind($stream); | ||
|
||
var_dump(fread($stream, 11)); | ||
var_dump(ftell($stream)); | ||
var_dump(feof($stream)); | ||
|
||
?> | ||
--EXPECT-- | ||
string(10) "0123456789" | ||
int(10) | ||
bool(false) | ||
string(10) "0123456789" | ||
int(10) | ||
bool(true) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5060fc2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check https://bugs.php.net/bug.php?id=75515
5060fc2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also symfony/symfony#24945
5060fc2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like while is_url might seem to be the most expedient answer to the question this diff was trying to answer, it's not the best answer. I'll do a partial revert which adds in exceptions for memory/temp streams.
5060fc2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0a45e8f should do the trick, and given that it's mostly a revert to RC5 state, I think it's okay to cherry-pick to 7.2.0. Thoughts?
5060fc2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas can you please give a try to this commit for 75515
@sgolemon I'm +1 for this in 7.2.0, changing test should usually raise our attention, and this revert the changed phpt to same as previous version.