forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Make processor class internal #7
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
Merged
ockham
merged 4 commits into
ockham:try/simplify-block-bindings-replace-html
from
sirreal:make-processor-class-internal
Aug 25, 2025
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Prev
Previous commit
Make the hidden class instance static
- Loading branch information
commit 7bd16b538e9623d5a670ded89e934050f3726ed8
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I’m assuming this was done as an optimization; if so, it’s pointless because anonymous classes are static in PHP anyway. At parse time it will create a separate class with a generated name and then when instantiating it or calling a static method on it, PHP calls from the generated class instead of some dynamic variable dispatch as the code suggests.
VLD output
Finding entry points Branch analysis from position: 0 1 jumps found. (Code = 62) Position 1 = -2 filename: /in/1H8Jo function name: (null) number of ops: 14 compiled vars: !0 = $c line #* E I O op fetch ext return operands ------------------------------------------------------------------------------------- 3 0 E > DECLARE_ANON_CLASS 1 NEW $2 $1 2 DO_FCALL 0 3 ASSIGN !0, $2 8 4 INIT_METHOD_CALL !0, 'speak' 5 DO_FCALL 0 $5 6 CONCAT ~6 $5, '%0A' 7 ECHO ~6 9 8 FETCH_CLASS 0 $7 !0 9 INIT_STATIC_METHOD_CALL $7, 'name' 10 DO_FCALL 0 $8 11 CONCAT ~9 $8, '%0A' 12 ECHO ~9 10 13 > RETURN 1
Class class@anonymous:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/1H8Jo
function name: speak
number of ops: 2
compiled vars: none
line #* E I O op fetch ext return operands
End of function speak
Function name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/1H8Jo
function name: name
number of ops: 2
compiled vars: none
line #* E I O op fetch ext return operands
End of function name
End of class class@anonymous.
so assigning it to a static variable does nothing but duplicate it.