-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate returning non-string values from a user output handler #18932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DanielEScherzer
wants to merge
9
commits into
php:master
Choose a base branch
from
DanielEScherzer:output-handler-non-string
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+474
−23
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f4c3fde
Deprecate returning non-string values from a user output handler
DanielEScherzer 340c7fd
Only disable the problematic output handler
DanielEScherzer 720923e
Tests
DanielEScherzer cfe4d71
upgrading
DanielEScherzer 51892ba
Handlers might be freed from OOM
DanielEScherzer 6a2d6c1
Location not always given
DanielEScherzer ab5acde
context is also unavailable
DanielEScherzer 25c35b8
No tabs
DanielEScherzer 8144c55
Memory limits
DanielEScherzer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Handlers might be freed from OOM
- Loading branch information
commit 51892ba751d0b3d1949a042544512f8f0fda3b10
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
21 changes: 21 additions & 0 deletions
21
tests/output/ob_start_callback_bad_return/handler_removed.phpt
This file contains hidden or 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,21 @@ | ||
--TEST-- | ||
ob_start(): Check behaviour with deprecation when OOM triggers handler removal | ||
--FILE-- | ||
DanielEScherzer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<?php | ||
|
||
ob_start(function() { | ||
// We are out of memory, now trigger a deprecation | ||
return false; | ||
}); | ||
|
||
$a = []; | ||
// trigger OOM in a resize operation | ||
while (1) { | ||
$a[] = 1; | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d | ||
|
||
Fatal error: Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes) in %s on line %d |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we have a better variable name than
iii
?