-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix error handling during opcache compilation #18541
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
arnaud-lb
wants to merge
11
commits into
php:master
Choose a base branch
from
arnaud-lb:gh17422
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.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
731db8e
opcache: Do not disable userland error handlers in `opcache_compile_f…
TimWolla 1dd8bf4
Make test expectation compatible with PHP 8.3 and PHP 8.4
TimWolla 279831c
Always record errors during compilation
arnaud-lb 6b0cabc
Generated file
arnaud-lb 4338079
Unify non-opcache behavior
arnaud-lb 801fd60
Fix test
arnaud-lb 3ec6d9d
Remove file
arnaud-lb 72766ed
Typo
arnaud-lb fd729cb
Simplify
arnaud-lb 167e45e
Enable opcache.record_warnings when opcache.file_cache is set, in the…
arnaud-lb 0127e1a
Quotes
arnaud-lb 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
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
35 changes: 35 additions & 0 deletions
35
Zend/tests/inheritance/deprecation_to_exception_during_inheritance_can_be_caught.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,35 @@ | ||
--TEST-- | ||
Deprecation promoted to exception during inheritance | ||
--SKIPIF-- | ||
<?php | ||
if (getenv('SKIP_PRELOAD')) die('skip Error handler not active during preloading'); | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
set_error_handler(function($code, $message) { | ||
throw new Exception($message); | ||
}); | ||
|
||
try { | ||
class C extends DateTime { | ||
public function getTimezone() {} | ||
public function getTimestamp() {} | ||
}; | ||
} catch (Exception $e) { | ||
printf("%s: %s\n", $e::class, $e->getMessage()); | ||
} | ||
|
||
var_dump(new C()); | ||
|
||
?> | ||
--EXPECTF-- | ||
Exception: Return type of C::getTimezone() should either be compatible with DateTime::getTimezone(): DateTimeZone|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice | ||
object(C)#%d (3) { | ||
["date"]=> | ||
string(%d) "%s" | ||
["timezone_type"]=> | ||
int(3) | ||
["timezone"]=> | ||
string(3) "UTC" | ||
} |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
This one fails when OPcache is not loaded. It still says the “During inheritance of C” bit. Thus:
This would make sense to me.