We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e22ff22 + 28faa56 commit f58f162Copy full SHA for f58f162
src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php
@@ -74,9 +74,18 @@ public function register()
74
75
// If we are not pattern matching, we need to work out what
76
// tokens to listen for.
77
- $string = '<?php ';
+ $hasHaltCompiler = false;
78
+ $string = '<?php ';
79
foreach ($this->forbiddenFunctionNames as $name) {
- $string .= $name.'();';
80
+ if ($name === '__halt_compiler') {
81
+ $hasHaltCompiler = true;
82
+ } else {
83
+ $string .= $name.'();';
84
+ }
85
86
+
87
+ if ($hasHaltCompiler === true) {
88
+ $string .= '__halt_compiler();';
89
}
90
91
$register = [];
0 commit comments