Completed
Push — master ( aee42a...b52690 )
by Wim
8s
created

MoreRefs::bar()   A

Complexity

Conditions 4
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 9.2
1
<?php
2
3
$a = 1;
4
5
class MoneyBags
6
{
7
}
8
9
function abc(&$foobar)
10
{
11
    return $foobar;
12
}
13
14
$right = abc($a);
15
$wrong = abc(&$a);
16
17
$a = E_STRICT; // Sniffer checks strings, and returns if no left paren afterwards
18
19
abc($x, $y, $z, &$a);
20
21
// nested function call
22
preg_replace($a, $b, trim(&$a));
23
24
foobar(3 & $a); // LNUMBER + &
25
foobar($a & $b); // variable + &
26
foobar($b[0] & $a); // square bracket + &
27
foobar(($a) & $b); // parenthesis + &
28
foobar(intval(3) & $b); // function + &
29
foobar(& $b);
30
31
define('MY_CONST', 0);
32
33
class MoreRefs
34
{
35
    const MYCONST = 1;
36
    private $attribute = 2;
37
38
    public function bar($arg)
39
    {
40
        $a = sprintf(
41
            '%s %s %s'
42
            , self::MYCONST & $arg ? 1 : 2
43
            , $this->attribute & $arg ? 5 : 6
44
            , MY_CONST & $arg ? 7 : 8
45
        );
46
    }
47
}