diff --git a/package.xml b/package.xml
index 9338b46e79..eff49f7791 100644
--- a/package.xml
+++ b/package.xml
@@ -1857,6 +1857,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
+
diff --git a/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php
index 343d9b29e3..dd5df2a858 100644
--- a/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php
+++ b/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php
@@ -258,6 +258,16 @@ public function process(File $phpcsFile, $stackPtr)
continue;
}
+ // Skip HTML whitespace.
+ if ($tokens[$i]['code'] === T_INLINE_HTML && \trim($tokens[$i]['content']) === '') {
+ continue;
+ }
+
+ // Skip PHP re-open tag (eg, after inline HTML).
+ if ($tokens[$i]['code'] === T_OPEN_TAG) {
+ continue;
+ }
+
$line = $tokens[$i]['line'];
if ($line > $lastLine) {
$type = substr($tokens[$stackPtr]['type'], 2);
diff --git a/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc b/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc
new file mode 100644
index 0000000000..9433aed0bb
--- /dev/null
+++ b/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ non-executable
+
+
+
+
+
+
+
+
+ non-executable
+
+
+
diff --git a/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php b/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php
index f5f90c0b92..70d8244895 100644
--- a/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php
+++ b/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php
@@ -86,6 +86,11 @@ public function getWarningList($testFile='')
54 => 2,
];
break;
+ case 'NonExecutableCodeUnitTest.3.inc':
+ return [
+ 19 => 1,
+ 28 => 1,
+ ];
default:
return [];
break;