-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHP8.1 Support (DOM&Compiler parser) - #149
* fix readonly as function name
- Loading branch information
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
24 changes: 24 additions & 0 deletions
24
tests/org.eclipse.php.core.tests/workspace/compiler_parser/php81/testReadonlyFunction.pdtt
This file contains 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,24 @@ | ||
--TEST-- | ||
PHP 8.1 | ||
--FILE-- | ||
<?php | ||
function readonly() {} | ||
|
||
readonly(); | ||
|
||
?> | ||
--EXPECT-- | ||
<ModuleDeclaration start="0" end="46"> | ||
<PHPMethodDeclaration start="6" end="28" modifiers="" name="readonly"> | ||
</PHPMethodDeclaration> | ||
<ExpressionStatement start="30" end="41"> | ||
<PHPCallExpression start="30" end="40"> | ||
<FullyQualifiedReference start="30" end="38" name="readonly"> | ||
</FullyQualifiedReference> | ||
<PHPCallArgumentsList start="39" end="39"> | ||
</PHPCallArgumentsList> | ||
</PHPCallExpression> | ||
</ExpressionStatement> | ||
<EmptyStatement start="43" end="45"> | ||
</EmptyStatement> | ||
</ModuleDeclaration> |
39 changes: 39 additions & 0 deletions
39
tests/org.eclipse.php.core.tests/workspace/dom_parser/php81/testReadonlyFunction.pdtt
This file contains 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,39 @@ | ||
--TEST-- | ||
PHP 8.1 | ||
--FILE-- | ||
<?php | ||
function readonly() {} | ||
|
||
readonly(); | ||
|
||
?> | ||
--EXPECT-- | ||
<Program start='0' length='45'> | ||
<Statements> | ||
<FunctionDeclaration start='6' length='22' isReference='false'> | ||
<FunctionName> | ||
<Identifier start='15' length='8' name='readonly'/> | ||
</FunctionName> | ||
<FormalParameters> | ||
</FormalParameters> | ||
<FunctionBody> | ||
<Block start='26' length='2' isCurly='true'> | ||
</Block> | ||
</FunctionBody> | ||
</FunctionDeclaration> | ||
<ExpressionStatement start='30' length='11'> | ||
<FunctionInvocation start='30' length='10'> | ||
<FunctionName start='30' length='8'> | ||
<NamespaceName start='30' length='8' global='false' current='false'> | ||
<Identifier start='30' length='8' name='readonly'/> | ||
</NamespaceName> | ||
</FunctionName> | ||
<Parameters> | ||
</Parameters> | ||
</FunctionInvocation> | ||
</ExpressionStatement> | ||
<EmptyStatement start='43' length='2'/> | ||
</Statements> | ||
<Comments> | ||
</Comments> | ||
</Program> |