forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Rfc: nested classes #5
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
withinboredom
wants to merge
26
commits into
master
Choose a base branch
from
rfc/nested-classes
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
26 commits
Select commit
Hold shift + click to select a range
0dc1c19
Add a test that fails
withinboredom 8905724
Add scope to class entries
withinboredom be18661
modify grammar
withinboredom d382a7f
namespaces: add support
withinboredom 05686a2
allow for defining nested classes
withinboredom a06723e
add more tests and fix a memory leak
withinboredom b369064
add more tests
withinboredom df7f149
add more tests
withinboredom d3b3666
add reflection support
withinboredom 0c70dae
rewrite scopes during opcache compilation
withinboredom 369af23
add tests for visibility
withinboredom 7d13444
handle protected/private lookups in outer classes
withinboredom 36c7c52
handle private/protected types in properties
withinboredom 3e14baf
do not elide return checks for private/protected inner classes
withinboredom 977643d
do not elide return checks for private/protected inner classes
withinboredom f26f1e9
add and update tests
withinboredom f28513d
handle instantiation protections
withinboredom 8e5f4d9
start keeping track of own nested classes
withinboredom b9ff2ec
simplify resolution logic
withinboredom fd69299
keep cased namespace names
withinboredom 7e754b7
add alias tests
withinboredom f7161a9
add more tests and fix a small visibility issue
withinboredom 9117b02
validate scope is set
withinboredom 2640748
allow enums and traits
withinboredom 10b2f63
only allow enums and fix test
withinboredom 21f7dfc
do not allow private/protected classes on interfaces
withinboredom 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
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
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.
🛠️ Refactor suggestion
Return after throwing the type error for protected classes.
Currently, the code calls
zend_type_error()
at line 1838 but does not setarg
to NULL or return immediately. The engine will still throw an exception, but for parallelism with the private-class block, consider returning right away to keep the logic uniform and prevent any unexpected continuation of object creation.Apply this diff to mirror the private-class pattern:
📝 Committable suggestion