diff --git a/package.xml b/package.xml
index f12183533c..00ff8ebff5 100644
--- a/package.xml
+++ b/package.xml
@@ -688,7 +688,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
+
+
diff --git a/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php b/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php
index e59ed5ffa7..d03bf8abe1 100644
--- a/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php
+++ b/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php
@@ -23,7 +23,10 @@ class ClosingPHPTagSniff implements Sniff
*/
public function register()
{
- return [T_OPEN_TAG];
+ return [
+ T_OPEN_TAG,
+ T_OPEN_TAG_WITH_ECHO,
+ ];
}//end register()
diff --git a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.inc b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.1.inc
similarity index 100%
rename from src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.inc
rename to src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.1.inc
diff --git a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc
new file mode 100644
index 0000000000..fc896ed197
--- /dev/null
+++ b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc
@@ -0,0 +1,5 @@
+= 'foo'; ?>
+Bold text
+= 'bar'; ?>
+Italic text
+= 'baz';
\ No newline at end of file
diff --git a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php
index bcadc38655..9c567b7bad 100644
--- a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php
+++ b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php
@@ -21,11 +21,22 @@ class ClosingPHPTagUnitTest extends AbstractSniffUnitTest
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
+ * @param string $testFile The name of the file being tested.
+ *
* @return array
*/
- public function getErrorList()
+ public function getErrorList($testFile='')
{
- return [9 => 1];
+ switch ($testFile) {
+ case 'ClosingPHPTagUnitTest.1.inc':
+ return [9 => 1];
+ case 'ClosingPHPTagUnitTest.2.inc':
+ return [5 => 1];
+ break;
+ default:
+ return [];
+ break;
+ }
}//end getErrorList()