-
-
Notifications
You must be signed in to change notification settings - Fork 348
Closed
pdepend/pdepend
#633Labels
Milestone
Description
- PHPMD version: 2.12.0
- PHP Version: 8.0.2
- Installation type: composer
- Operating System / Distribution & Version: Not relevant
Current Behavior
This (valid) code:
$myObject = new (SomeArbitraryCode::class . 'loremIpsum' . trim(' Hello '))($arg1, $arg2);
Leads to the following error:
Unexpected token: (, line: xx, col: xx, file: xxxxxxxxxxx.php.
#0 xxxxxxxxxxx\vendor\pdepend\pdepend\src\main\php\PDepend\Source\Language\PHP\AbstractPHPParser.php(7844): PDepend\Source\Parser\UnexpectedTokenException->__construct(Object(PDepend\Source\Tokenizer\Token), Object(PDepend\Source\AST\ASTCompilationUnit)
)
Expected Behavior
No error, dynamic class instantiation has been introduced as of PHP 8:
https://www.php.net/manual/en/language.oop5.basic.php
Steps To Reproduce:
Just analyses the piece of code above.
Checks before submitting
- Be sure that there isn't already an issue about this. See: Issues list
- Be sure that there isn't already a pull request about this. See: Pull requests
- I have added every step to reproduce the bug.
- If possible I added relevant code examples.
- This issue is about 1 bug and nothing more.
- The issue has a descriptive title. For example: "JSON rendering failed on Windows for filenames with space".
Reactions are currently unavailable