zend_ast: Wrap class names in parens during export when they are an expression#22389
Conversation
add205b to
9c7592b
Compare
|
|
9c7592b to
6d478dd
Compare
|
I had seen that and then during testing it complained about Now fixed, thanks. |
6d478dd to
b597b35
Compare
| @@ -0,0 +1,62 @@ | |||
| --TEST-- | |||
| GH-22387: AST pretty-printing drops meaningful parentheses around RHS of instanceof | |||
There was a problem hiding this comment.
This test does more than check instanceof.
There was a problem hiding this comment.
Yes, this is borrowing the title from the associated issue (and then testing some related logic).
| break; | ||
| case ZEND_AST_STATIC_CALL: | ||
| zend_ast_export_ns_name(str, ast->child[0], 0, indent); | ||
| if (zend_ast_is_parent_hook_call(ast)) { |
There was a problem hiding this comment.
I assume this is already tested elsewhere?
There was a problem hiding this comment.
Yes, Zend/tests/property_hooks/ast_printing.phpt fails without this check:
TEST 11/211 [Zend/tests/property_hooks/ast_printing.phpt]
========DIFF========
--
}
public $prop2 {
get {
008- return parent::$prop1::get();
008+ return (parent::$prop1)::get();
}
final set {
echo 'Foo';
--
========DONE========
FAIL Hook AST printing [Zend/tests/property_hooks/ast_printing.phpt]
b597b35 to
34502c1
Compare
Fixes #22387.