Unexpected token when using more varaibles in <?= ?> php echo statement
Open
@kylekatarnls is already working on this.
Since Aug 27, 2022.
Bug
PDepend
- Dominant language
- PHP
- Stars
- 2.5k
- Forks
- 361
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 11
Description
- PHPMD version: 2.12.0
- PHP Version: 8.0, 8.1
- Installation type: composer, in docker image
- Operating System / Distribution & Version: Alpine, ubuntu 20.04
Current Behavior
Unexpected token: ,, line: 6, col: 10, file:: /test.php
Expected Behavior
Analysis should work
Steps To Reproduce:
- Install PHPMD
composer require --dev phpmd/phpmd - create
test.phpfile with code example below - run
php vendor/bin/phpmd test.php ansi naming
Example code
<?php
$var1 = 'foo';
$var2 = 'bar';
?>
<?= $var1,$var2 ?>
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".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.