Closed
Description
Problem
A variable is not counted as used in a short open echo tag:
<?php
$a = 'foo'; // incorrectly marked as UnusedVariable
?>
<p><?= $a ?></p>
Cases that currently work
The sniff will correctly identify this variable as used if another statement follows it (or another short open echo tag):
<?php
$a = 'foo';
?>
<p><?= $a ?></p>
<p><?= 'more' ?></p>
It also correctly identifies the variable as used if the short echo tag includes a semicolon:
<?php
$a = 'foo';
?>
<p><?= $a; ?></p>
Metadata
Metadata
Assignees
Labels
No labels