Skip to content

Commit 5cc2790

Browse files
committed
Fixed bug #19879 : bitwise and operator interpreted as reference by value
1 parent 3d76bbb commit 5cc2790

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
126126
switch ($tokens[$tokenBefore]['code']) {
127127
case T_VARIABLE:
128128
case T_CLOSE_PARENTHESIS:
129+
case T_LNUMBER:
129130
// In these cases T_BITWISE_AND represents
130131
// the bitwise and operator.
131132
continue;

CodeSniffer/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ myclass::myfunc($myvar);
1717

1818
while(testfunc($var1, &$var2, $var3, &$var4) === false) {
1919
}
20+
21+
sprintf("0%o", 0777 & $p);
2022
?>

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
5454
- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff
5555
- Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed
5656
- Fixed bug #19871 : findExtendedClassName doesn't return FQCN on namespaced classes
57+
- Fixed bug #19879 : bitwise and operator interpreted as reference by value
5758
</notes>
5859
<contents>
5960
<dir name="/">

0 commit comments

Comments
 (0)